
<!doctype html>
<html lang="zh" class="no-js">
  <head>
    
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width,initial-scale=1">
      
        <meta name="description" content="个人工作学习，生物信息学和服务器开发运维方向的博文总结。">
      
      
        <meta name="author" content="章鱼猫先生">
      
      
        <link rel="canonical" href="https://shenlab.cn/yuque/%E7%BC%96%E7%A8%8B%E6%8A%80%E6%9C%AF/Python/2019-07-01-python-file-directory-toturial/">
      
      
        <link rel="prev" href="../2019-09-19-xu2eg5/">
      
      
        <link rel="next" href="../2019-06-11-iddn10/">
      
      
        <link rel="alternate" type="application/rss+xml" title="RSS 订阅" href="../../../../feed_rss_created.xml">
        <link rel="alternate" type="application/rss+xml" title="已更新内容的 RSS 订阅" href="../../../../feed_rss_updated.xml">
      
      <link rel="icon" href="../../../../assets/logo.ico">
      <meta name="generator" content="mkdocs-1.5.3, mkdocs-material-9.5.1">
    
    
      
        <title>Python 文件与目录操作方法总结 - 个人技术空间</title>
      
    
    
      <link rel="stylesheet" href="../../../../assets/stylesheets/main.45e1311d.min.css">
      
        
        <link rel="stylesheet" href="../../../../assets/stylesheets/palette.06af60db.min.css">
      
      


    
    
      
    
    
      
        
        
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Microsoft+Yahei:300,300i,400,400i,700,700i%7CConsolas,Courier,courier+new,stkaiti,kaiti,simkai,monospace:400,400i,700,700i&display=fallback">
        <style>:root{--md-text-font:"Microsoft Yahei";--md-code-font:"Consolas,Courier,courier new,stkaiti,kaiti,simkai,monospace"}</style>
      
    
    
      <link rel="stylesheet" href="../../../../css/extra.css">
    
    <script>__md_scope=new URL("../../../..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
    
      
  


  <script async src="https://umami.weiyan.cc/script.js" data-website-id="b713abc7-f5eb-4683-a132-9fda53e29198"></script>
  
    <script>"undefined"!=typeof __md_analytics&&__md_analytics()</script>
  

    
    
    
    <meta name="referrer" content="no-referrer">

   <link href="../../../../assets/stylesheets/glightbox.min.css" rel="stylesheet"/><style>
        html.glightbox-open { overflow: initial; height: 100%; }
        .gslide-title { margin-top: 0px; user-select: text; }
        .gslide-desc { color: #666; user-select: text; }
        .gslide-image img { background: white; }
        
            .gscrollbar-fixer { padding-right: 15px; }
            .gdesc-inner { font-size: 0.75rem; }
            body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
            body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
            body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}
            </style> <script src="../../../../assets/javascripts/glightbox.min.js"></script></head>
  
  
    
    
      
    
    
    
    
    <body dir="ltr" data-md-color-scheme="default" data-md-color-primary="grey" data-md-color-accent="indigo">
  
    
    <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
    <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
    <label class="md-overlay" for="__drawer"></label>
    <div data-md-component="skip">
      
        
        <a href="#python-读写数据到文件" class="md-skip">
          跳转至
        </a>
      
    </div>
    <div data-md-component="announce">
      
    </div>
    
    
      

<header class="md-header" data-md-component="header">
  <nav class="md-header__inner md-grid" aria-label="页眉">
    <a href="https://shenlab.cn" title="个人技术空间" class="md-header__button md-logo" aria-label="个人技术空间" data-md-component="logo">
      
  <img src="../../../../assets/octocat.png" alt="logo">

    </a>
    <label class="md-header__button md-icon" for="__drawer">
      
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg>
    </label>
    <div class="md-header__title" data-md-component="header-title">
      <div class="md-header__ellipsis">
        <div class="md-header__topic">
          <span class="md-ellipsis">
            个人技术空间
          </span>
        </div>
        <div class="md-header__topic" data-md-component="header-topic">
          <span class="md-ellipsis">
            
              Python 文件与目录操作方法总结
            
          </span>
        </div>
      </div>
    </div>
    
      
        <form class="md-header__option" data-md-component="palette">
  
    
    
    
    <input class="md-option" data-md-color-media="" data-md-color-scheme="default" data-md-color-primary="grey" data-md-color-accent="indigo"  aria-label="Switch to dark mode"  type="radio" name="__palette" id="__palette_0">
    
      <label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_1" hidden>
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.5 2c-1.79 1.15-3 3.18-3 5.5s1.21 4.35 3.03 5.5C4.46 13 2 10.54 2 7.5A5.5 5.5 0 0 1 7.5 2m11.57 1.5 1.43 1.43L4.93 20.5 3.5 19.07 19.07 3.5m-6.18 2.43L11.41 5 9.97 6l.42-1.7L9 3.24l1.75-.12.58-1.65L12 3.1l1.73.03-1.35 1.13.51 1.67m-3.3 3.61-1.16-.73-1.12.78.34-1.32-1.09-.83 1.36-.09.45-1.29.51 1.27 1.36.03-1.05.87.4 1.31M19 13.5a5.5 5.5 0 0 1-5.5 5.5c-1.22 0-2.35-.4-3.26-1.07l7.69-7.69c.67.91 1.07 2.04 1.07 3.26m-4.4 6.58 2.77-1.15-.24 3.35-2.53-2.2m4.33-2.7 1.15-2.77 2.2 2.54-3.35.23m1.15-4.96-1.14-2.78 3.34.24-2.2 2.54M9.63 18.93l2.77 1.15-2.53 2.19-.24-3.34Z"/></svg>
      </label>
    
  
    
    
    
    <input class="md-option" data-md-color-media="" data-md-color-scheme="slate" data-md-color-primary="grey" data-md-color-accent="indigo"  aria-label="Switch to light mode"  type="radio" name="__palette" id="__palette_1">
    
      <label class="md-header__button md-icon" title="Switch to light mode" for="__palette_0" hidden>
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.5 2c-1.79 1.15-3 3.18-3 5.5s1.21 4.35 3.03 5.5C4.46 13 2 10.54 2 7.5A5.5 5.5 0 0 1 7.5 2m11.57 1.5 1.43 1.43L4.93 20.5 3.5 19.07 19.07 3.5m-6.18 2.43L11.41 5 9.97 6l.42-1.7L9 3.24l1.75-.12.58-1.65L12 3.1l1.73.03-1.35 1.13.51 1.67m-3.3 3.61-1.16-.73-1.12.78.34-1.32-1.09-.83 1.36-.09.45-1.29.51 1.27 1.36.03-1.05.87.4 1.31M19 13.5a5.5 5.5 0 0 1-5.5 5.5c-1.22 0-2.35-.4-3.26-1.07l7.69-7.69c.67.91 1.07 2.04 1.07 3.26m-4.4 6.58 2.77-1.15-.24 3.35-2.53-2.2m4.33-2.7 1.15-2.77 2.2 2.54-3.35.23m1.15-4.96-1.14-2.78 3.34.24-2.2 2.54M9.63 18.93l2.77 1.15-2.53 2.19-.24-3.34Z"/></svg>
      </label>
    
  
</form>
      
    
    
      <script>var media,input,key,value,palette=__md_get("__palette");if(palette&&palette.color){"(prefers-color-scheme)"===palette.color.media&&(media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']"),palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent"));for([key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
    
    
    
      <label class="md-header__button md-icon" for="__search">
        
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
      </label>
      <div class="md-search" data-md-component="search" role="dialog">
  <label class="md-search__overlay" for="__search"></label>
  <div class="md-search__inner" role="search">
    <form class="md-search__form" name="search">
      <input type="text" class="md-search__input" name="query" aria-label="搜索" placeholder="搜索" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
      <label class="md-search__icon md-icon" for="__search">
        
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
        
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
      </label>
      <nav class="md-search__options" aria-label="查找">
        
        <button type="reset" class="md-search__icon md-icon" title="清空当前内容" aria-label="清空当前内容" tabindex="-1">
          
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41Z"/></svg>
        </button>
      </nav>
      
    </form>
    <div class="md-search__output">
      <div class="md-search__scrollwrap" data-md-scrollfix>
        <div class="md-search-result" data-md-component="search-result">
          <div class="md-search-result__meta">
            正在初始化搜索引擎
          </div>
          <ol class="md-search-result__list" role="presentation"></ol>
        </div>
      </div>
    </div>
  </div>
</div>
    
    
      <div class="md-header__source">
        <a href="https://github.com/shenweiyan/ShenLab-CN/" title="前往仓库" class="md-source" data-md-component="source">
  <div class="md-source__icon md-icon">
    
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
  </div>
  <div class="md-source__repository">
    Knowledge-Garden
  </div>
</a>
      </div>
    
  </nav>
  
</header>
    
    <div class="md-container" data-md-component="container">
      
      
        
          
            
<nav class="md-tabs" aria-label="标签" data-md-component="tabs">
  <div class="md-grid">
    <ul class="md-tabs__list">
      
        
  
  
  
    <li class="md-tabs__item">
      <a href="../../../.." class="md-tabs__link">
        
  
    
  
  主页

      </a>
    </li>
  

      
        
  
  
  
    
    
      <li class="md-tabs__item">
        <a href="../../../../tech/" class="md-tabs__link">
          
  
    
  
  技术

        </a>
      </li>
    
  

      
        
  
  
  
    
    
      <li class="md-tabs__item">
        <a href="../../../../galaxy/" class="md-tabs__link">
          
  
    
  
  平台

        </a>
      </li>
    
  

      
        
  
  
  
    
    
      <li class="md-tabs__item">
        <a href="../../../../blog/" class="md-tabs__link">
          
  
    
  
  博客

        </a>
      </li>
    
  

      
        
  
  
    
  
  
    
    
      <li class="md-tabs__item md-tabs__item--active">
        <a href="../../../" class="md-tabs__link">
          
  
    
  
  语雀

        </a>
      </li>
    
  

      
        
  
  
  
    
    
      <li class="md-tabs__item">
        <a href="../../../../note/" class="md-tabs__link">
          
  
    
  
  随笔

        </a>
      </li>
    
  

      
        
  
  
  
    
    
      <li class="md-tabs__item">
        <a href="../../../../message/" class="md-tabs__link">
          
  
    
  
  留言

        </a>
      </li>
    
  

      
        
  
  
  
    
    
      <li class="md-tabs__item">
        <a href="../../../../readme/" class="md-tabs__link">
          
  
    
  
  关于

        </a>
      </li>
    
  

      
        
  
  
  
    
    
      <li class="md-tabs__item">
        <a href="../../../../flinks/" class="md-tabs__link">
          
  
    
  
  友链

        </a>
      </li>
    
  

      
        
  
  
  
    <li class="md-tabs__item">
      <a href="https://weiyan.cc/feed_rss_created.xml" class="md-tabs__link">
        
  
    
  
  RSS

      </a>
    </li>
  

      
    </ul>
  </div>
</nav>
          
        
      
      <main class="md-main" data-md-component="main">
        <div class="md-main__inner md-grid">
          
            
              
              <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
                <div class="md-sidebar__scrollwrap">
                  <div class="md-sidebar__inner">
                    


  


<nav class="md-nav md-nav--primary md-nav--lifted" aria-label="导航栏" data-md-level="0">
  <label class="md-nav__title" for="__drawer">
    <a href="https://shenlab.cn" title="个人技术空间" class="md-nav__button md-logo" aria-label="个人技术空间" data-md-component="logo">
      
  <img src="../../../../assets/octocat.png" alt="logo">

    </a>
    个人技术空间
  </label>
  
    <div class="md-nav__source">
      <a href="https://github.com/shenweiyan/ShenLab-CN/" title="前往仓库" class="md-source" data-md-component="source">
  <div class="md-source__icon md-icon">
    
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
  </div>
  <div class="md-source__repository">
    Knowledge-Garden
  </div>
</a>
    </div>
  
  <ul class="md-nav__list" data-md-scrollfix>
    
      
      
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../.." class="md-nav__link">
        
  
  <span class="md-ellipsis">
    主页
  </span>
  

      </a>
    </li>
  

    
      
      
  
  
  
  
    
    
      
        
          
        
      
        
      
        
      
        
      
        
      
        
      
    
    
    
    
      
      
    
    <li class="md-nav__item md-nav__item--section md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2" >
        
          
          
          <div class="md-nav__link md-nav__container">
            <a href="../../../../tech/" class="md-nav__link ">
              
  
  <span class="md-ellipsis">
    技术
  </span>
  

            </a>
            
              
              <label class="md-nav__link " for="__nav_2" id="__nav_2_label" tabindex="">
                <span class="md-nav__icon md-icon"></span>
              </label>
            
          </div>
        
        <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_2">
            <span class="md-nav__icon md-icon"></span>
            技术
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
            
              
                
  
  
  
  
    
    
      
        
          
        
      
    
    
    
    
      
      
    
    <li class="md-nav__item md-nav__item--section md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2_2" >
        
          
          
          <div class="md-nav__link md-nav__container">
            <a href="../../../../tech/%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/" class="md-nav__link ">
              
  
  <span class="md-ellipsis">
    生物信息
  </span>
  

            </a>
            
          </div>
        
        <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_2_2_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_2_2">
            <span class="md-nav__icon md-icon"></span>
            生物信息
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
          
        
      
        
      
    
    
    
    
      
      
    
    <li class="md-nav__item md-nav__item--section md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2_3" >
        
          
          
          <div class="md-nav__link md-nav__container">
            <a href="../../../../tech/%E7%BC%96%E7%A8%8B%E6%8A%80%E6%9C%AF/" class="md-nav__link ">
              
  
  <span class="md-ellipsis">
    编程技术
  </span>
  

            </a>
            
              
              <label class="md-nav__link " for="__nav_2_3" id="__nav_2_3_label" tabindex="">
                <span class="md-nav__icon md-icon"></span>
              </label>
            
          </div>
        
        <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_2_3_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_2_3">
            <span class="md-nav__icon md-icon"></span>
            编程技术
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2_3_2" >
        
          
          <label class="md-nav__link" for="__nav_2_3_2" id="__nav_2_3_2_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    Python
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_2_3_2_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_2_3_2">
            <span class="md-nav__icon md-icon"></span>
            Python
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../discussions-61/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Python 里面没 if 也能用 else
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../discussions-44/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    不要使用 requirements.txt
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../discussions-40/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Pandas 处理 Excel 常用方法技巧
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../discussions-30/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    单行 Python 代码片段
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
          
        
      
        
      
        
      
    
    
    
    
      
      
    
    <li class="md-nav__item md-nav__item--section md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2_4" >
        
          
          
          <div class="md-nav__link md-nav__container">
            <a href="../../../../tech/%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/" class="md-nav__link ">
              
  
  <span class="md-ellipsis">
    开发运维
  </span>
  

            </a>
            
              
              <label class="md-nav__link " for="__nav_2_4" id="__nav_2_4_label" tabindex="">
                <span class="md-nav__icon md-icon"></span>
              </label>
            
          </div>
        
        <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_2_4_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_2_4">
            <span class="md-nav__icon md-icon"></span>
            开发运维
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    
    
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2_4_1" >
        
          
          <label class="md-nav__link" for="__nav_2_4_1" id="__nav_2_4_1_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    静态网站
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_2_4_1_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_2_4_1">
            <span class="md-nav__icon md-icon"></span>
            静态网站
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../discussions-10/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    WebStack-Hugo | 一个静态响应式导航主题
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2_4_2" >
        
          
          <label class="md-nav__link" for="__nav_2_4_2" id="__nav_2_4_2_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    虚拟环境
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_2_4_2_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_2_4_2">
            <span class="md-nav__icon md-icon"></span>
            虚拟环境
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../discussions-24/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Micro/Mamba 安装与注意事项
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2_4_3" >
        
          
          <label class="md-nav__link" for="__nav_2_4_3" id="__nav_2_4_3_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    服务器配置使用
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_2_4_3_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_2_4_3">
            <span class="md-nav__icon md-icon"></span>
            服务器配置使用
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../discussions-60/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    RockyLinux 9 基础配置与使用
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../discussions-25/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    不同版本服务器间 SSH 免密码登录失败
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../discussions-9/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    在 Linux 上给用户赋予指定目录的读写权限
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
            
              
                
  
  
  
  
    
    
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2_4_5" >
        
          
          <label class="md-nav__link" for="__nav_2_4_5" id="__nav_2_4_5_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    Windows
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_2_4_5_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_2_4_5">
            <span class="md-nav__icon md-icon"></span>
            Windows
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../discussions-49/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    苹果字体 PingFang SC 的一些踩坑记录
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2_4_6" >
        
          
          <label class="md-nav__link" for="__nav_2_4_6" id="__nav_2_4_6_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    Python
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_2_4_6_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_2_4_6">
            <span class="md-nav__icon md-icon"></span>
            Python
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../discussions-27/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Python3 编译安装 --with-openssl 无效的问题
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../discussions-12/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Python 中 tkinter 源码安装使用与中文乱码
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../discussions-13/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Python3 源码安装
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
          
        
      
    
    
    
    
      
      
    
    <li class="md-nav__item md-nav__item--section md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2_5" >
        
          
          
          <div class="md-nav__link md-nav__container">
            <a href="../../../../tech/%E6%95%B0%E6%8D%AE%E5%BA%93/" class="md-nav__link ">
              
  
  <span class="md-ellipsis">
    数据库
  </span>
  

            </a>
            
          </div>
        
        <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_2_5_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_2_5">
            <span class="md-nav__icon md-icon"></span>
            数据库
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
          
        
      
    
    
    
    
      
      
    
    <li class="md-nav__item md-nav__item--section md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2_6" >
        
          
          
          <div class="md-nav__link md-nav__container">
            <a href="../../../../tech/%E5%8F%AF%E8%A7%86%E5%8C%96/" class="md-nav__link ">
              
  
  <span class="md-ellipsis">
    可视化
  </span>
  

            </a>
            
          </div>
        
        <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_2_6_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_2_6">
            <span class="md-nav__icon md-icon"></span>
            可视化
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
            
          </ul>
        </nav>
      
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

    
      
      
  
  
  
  
    
    
      
        
          
        
      
        
      
        
      
        
      
        
      
    
    
    
    
      
      
    
    <li class="md-nav__item md-nav__item--section md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" >
        
          
          
          <div class="md-nav__link md-nav__container">
            <a href="../../../../galaxy/" class="md-nav__link ">
              
  
  <span class="md-ellipsis">
    平台
  </span>
  

            </a>
            
              
              <label class="md-nav__link " for="__nav_3" id="__nav_3_label" tabindex="">
                <span class="md-nav__icon md-icon"></span>
              </label>
            
          </div>
        
        <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_3">
            <span class="md-nav__icon md-icon"></span>
            平台
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../release" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    版本说明
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
    
    
    
    
      
      
    
    <li class="md-nav__item md-nav__item--section md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_3" >
        
          
          <label class="md-nav__link" for="__nav_3_3" id="__nav_3_3_label" tabindex="">
            
  
  <span class="md-ellipsis">
    管理员文档
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_3_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_3_3">
            <span class="md-nav__icon md-icon"></span>
            管理员文档
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    
    
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_3_1" >
        
          
          <label class="md-nav__link" for="__nav_3_3_1" id="__nav_3_3_1_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    Administration
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_3_3_1_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_3_3_1">
            <span class="md-nav__icon md-icon"></span>
            Administration
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../discussions-47/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    3211-支持的 Python 版本
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../discussions-48/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    3212-框架依赖
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../devel" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    开发者文档
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
    
    
    
    
      
      
    
    <li class="md-nav__item md-nav__item--section md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_5" >
        
          
          <label class="md-nav__link" for="__nav_3_5" id="__nav_3_5_label" tabindex="">
            
  
  <span class="md-ellipsis">
    其他文档
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_5_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_3_5">
            <span class="md-nav__icon md-icon"></span>
            其他文档
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../discussions-57/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    使用 Planemo 进行 Galaxy 工具开发
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../discussions-46/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Galaxy Project 的 Sphinx 文档部署
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

    
      
      
  
  
  
  
    
    
      
        
          
        
      
        
      
        
      
    
    
    
    
      
      
    
    <li class="md-nav__item md-nav__item--section md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4" >
        
          
          
          <div class="md-nav__link md-nav__container">
            <a href="../../../../blog/" class="md-nav__link ">
              
  
  <span class="md-ellipsis">
    博客
  </span>
  

            </a>
            
              
              <label class="md-nav__link " for="__nav_4" id="__nav_4_label" tabindex="">
                <span class="md-nav__icon md-icon"></span>
              </label>
            
          </div>
        
        <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_4">
            <span class="md-nav__icon md-icon"></span>
            博客
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
    
    
    
    
      
      
    
    <li class="md-nav__item md-nav__item--section md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4_2" >
        
          
          <label class="md-nav__link" for="__nav_4_2" id="__nav_4_2_label" tabindex="">
            
  
  <span class="md-ellipsis">
    归档
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_4_2_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_4_2">
            <span class="md-nav__icon md-icon"></span>
            归档
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
    
  
  
    <li class="md-nav__item">
      <a href="../../../../blog/archive/2024/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    2024
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
    
  
  
    <li class="md-nav__item">
      <a href="../../../../blog/archive/2023/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    2023
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
      
    
    
    
    
      
      
    
    <li class="md-nav__item md-nav__item--section md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4_3" >
        
          
          <label class="md-nav__link" for="__nav_4_3" id="__nav_4_3_label" tabindex="">
            
  
  <span class="md-ellipsis">
    分类
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_4_3_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_4_3">
            <span class="md-nav__icon md-icon"></span>
            分类
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
    
  
  
    <li class="md-nav__item">
      <a href="../../../../blog/category/%E4%B9%B1%E5%BC%B9/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    乱弹
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
    
  
  
    <li class="md-nav__item">
      <a href="../../../../blog/category/%E5%A5%BD%E7%8E%A9/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    好玩
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
    
  
  
    <li class="md-nav__item">
      <a href="../../../../blog/category/%E7%9F%A5%E8%AF%86/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    知识
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
    
  
  
    <li class="md-nav__item">
      <a href="../../../../blog/category/%E8%B5%84%E8%AE%AF/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    资讯
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

    
      
      
  
  
    
  
  
  
    
    
      
        
          
        
      
        
      
        
      
        
      
        
      
        
      
        
      
    
    
    
    
      
      
    
    <li class="md-nav__item md-nav__item--active md-nav__item--section md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5" checked>
        
          
          
          <div class="md-nav__link md-nav__container">
            <a href="../../../" class="md-nav__link ">
              
  
  <span class="md-ellipsis">
    语雀
  </span>
  

            </a>
            
              
              <label class="md-nav__link " for="__nav_5" id="__nav_5_label" tabindex="">
                <span class="md-nav__icon md-icon"></span>
              </label>
            
          </div>
        
        <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="true">
          <label class="md-nav__title" for="__nav_5">
            <span class="md-nav__icon md-icon"></span>
            语雀
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
      
        
      
        
      
        
          
        
      
    
    
    
    
      
      
    
    <li class="md-nav__item md-nav__item--section md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_2" >
        
          
          
          <div class="md-nav__link md-nav__container">
            <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/" class="md-nav__link ">
              
  
  <span class="md-ellipsis">
    生物信息
  </span>
  

            </a>
            
              
              <label class="md-nav__link " for="__nav_5_2" id="__nav_5_2_label" tabindex="">
                <span class="md-nav__icon md-icon"></span>
              </label>
            
          </div>
        
        <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_2_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_2">
            <span class="md-nav__icon md-icon"></span>
            生物信息
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_2_1" >
        
          
          <label class="md-nav__link" for="__nav_5_2_1" id="__nav_5_2_1_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    软件
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_2_1_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_2_1">
            <span class="md-nav__icon md-icon"></span>
            软件
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E8%BD%AF%E4%BB%B6/2023-06-14-r-sf/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    这个 R 包折腾了一天终于安装上了
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E8%BD%AF%E4%BB%B6/2023-03-29-nng7czgi43iwaw6d/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    BLAT 和 UCSC 系列工具源码编译安装
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E8%BD%AF%E4%BB%B6/2023-03-23-rnafold/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    ViennaRNA 安装使用
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E8%BD%AF%E4%BB%B6/2023-01-05-hru8nl3amnloeycg/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    SOAPdenovo 使用备忘
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E8%BD%AF%E4%BB%B6/2022-08-11-sds4gt/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Htslib 软件库安装与注意
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E8%BD%AF%E4%BB%B6/2020-09-10-yu6mtk/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Enembl VEP 安装备忘
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E8%BD%AF%E4%BB%B6/2020-08-27-mb7tcg/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    RepeatModeler 安装及使用
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E8%BD%AF%E4%BB%B6/2020-08-17-gdc-client-for-redhat-centos/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    在 RHEL 使用 gdc-client 下载 TCGA 数据
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E8%BD%AF%E4%BB%B6/2020-07-03-xo4ieg/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    SCI 投稿中像素、DPI、图片分辨率的一些知识
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E8%BD%AF%E4%BB%B6/2019-08-05-bioconductor-orgdb/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Bioconductor org.Xx.eg.db 系列包
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E8%BD%AF%E4%BB%B6/2019-07-04-clumpify/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    一款能使压缩 fq 再缩小 30% 并加速后续分析的软件
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E8%BD%AF%E4%BB%B6/2019-07-01-python-mygene/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    使用 Python 中的 mygene 模块进行 ID 匹配
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_2_2" >
        
          
          <label class="md-nav__link" for="__nav_5_2_2" id="__nav_5_2_2_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    资源
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_2_2_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_2_2">
            <span class="md-nav__icon md-icon"></span>
            资源
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E8%B5%84%E6%BA%90/2021-08-03-xn57o7/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    常用物种拉丁名
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E8%B5%84%E6%BA%90/2020-06-23-baatnb/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    生物信息学的一些开源学习资源
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E8%B5%84%E6%BA%90/2020-05-28-bio-rss-feeds/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    顶级生物信息学 RSS 订阅源
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E8%B5%84%E6%BA%90/2019-05-29-bio-blogs-forums/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    生物信息学博客与论坛
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_2_3" >
        
          
          <label class="md-nav__link" for="__nav_5_2_3" id="__nav_5_2_3_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    比对
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_2_3_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_2_3">
            <span class="md-nav__icon md-icon"></span>
            比对
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E6%AF%94%E5%AF%B9/2019-12-03-ygnigy/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    为什么 Biopython 的在线 BLAST 这么慢
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_2_4" >
        
          
          <label class="md-nav__link" for="__nav_5_2_4" id="__nav_5_2_4_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    杂项
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_2_4_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_2_4">
            <span class="md-nav__icon md-icon"></span>
            杂项
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E6%9D%82%E9%A1%B9/2022-12-16-mbk23ltbm8qq143z/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    新冠肺炎与疫苗的基本知识
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E6%9D%82%E9%A1%B9/2021-12-16-edam/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    生物科学数据分析和数据管理本体论
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_2_5" >
        
          
          <label class="md-nav__link" for="__nav_5_2_5" id="__nav_5_2_5_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    方法
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_2_5_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_2_5">
            <span class="md-nav__icon md-icon"></span>
            方法
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E6%96%B9%E6%B3%95/2019-12-05-nvi8vg/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    GO 功能富集分析结果绘图 R 代码
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E6%96%B9%E6%B3%95/2019-12-05-enrichment-analysis/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    基因功能富集原理学习笔记
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E6%96%B9%E6%B3%95/2019-12-05-enrichment-analysis-differentiation/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    富集分析的几个区别
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_2_6" >
        
          
          <label class="md-nav__link" for="__nav_5_2_6" id="__nav_5_2_6_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    数据
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_2_6_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_2_6">
            <span class="md-nav__icon md-icon"></span>
            数据
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E6%95%B0%E6%8D%AE/2023-03-27-qdlrkzttripr9wgg/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Python 均匀地分割字符串
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E7%94%9F%E7%89%A9%E4%BF%A1%E6%81%AF/%E6%95%B0%E6%8D%AE/2021-09-26-unable-to-get-local-issuer-certifica/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Python 获取 NCBI 基因名 SSL 证书出现异常
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
          
        
      
        
      
        
      
    
    
    
    
      
      
    
    <li class="md-nav__item md-nav__item--section md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_3" >
        
          
          
          <div class="md-nav__link md-nav__container">
            <a href="../../../%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/" class="md-nav__link ">
              
  
  <span class="md-ellipsis">
    操作系统
  </span>
  

            </a>
            
              
              <label class="md-nav__link " for="__nav_5_3" id="__nav_5_3_label" tabindex="">
                <span class="md-nav__icon md-icon"></span>
              </label>
            
          </div>
        
        <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_3_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_3">
            <span class="md-nav__icon md-icon"></span>
            操作系统
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    
    
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_3_1" >
        
          
          <label class="md-nav__link" for="__nav_5_3_1" id="__nav_5_3_1_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    openEuler
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_3_1_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_3_1">
            <span class="md-nav__icon md-icon"></span>
            openEuler
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/openEuler/2021-11-26-psetzg/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    管理用户和用户组
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/openEuler/2021-10-27-about-openeuler/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    关于 openEuler
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_3_3" >
        
          
          <label class="md-nav__link" for="__nav_5_3_3" id="__nav_5_3_3_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    RHEL
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_3_3_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_3_3">
            <span class="md-nav__icon md-icon"></span>
            RHEL
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/RHEL/2021-11-26-ut1tmm/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    基础配置
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/RHEL/2021-11-26-about-rhel/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    关于 RHEL
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_3_4" >
        
          
          <label class="md-nav__link" for="__nav_5_3_4" id="__nav_5_3_4_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    Debian
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_3_4_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_3_4">
            <span class="md-nav__icon md-icon"></span>
            Debian
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    
    
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_3_4_1" >
        
          
          <label class="md-nav__link" for="__nav_5_3_4_1" id="__nav_5_3_4_1_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    软件包管理
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="4" aria-labelledby="__nav_5_3_4_1_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_3_4_1">
            <span class="md-nav__icon md-icon"></span>
            软件包管理
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/Debian/%E8%BD%AF%E4%BB%B6%E5%8C%85%E7%AE%A1%E7%90%86/2021-11-26-imno9x/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    GCC 套件
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/Debian/2021-11-26-ytodmy/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    基础配置
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/Debian/2021-11-26-hlgbmo/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    管理用户和用户组
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/Debian/2021-11-26-gyhb14/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    磁盘管理
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/Debian/2021-10-21-about-debian-ubuntu/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    关于 Debian 和 Ubuntu
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
          
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
    
    
    
    
      
      
    
    <li class="md-nav__item md-nav__item--section md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4" >
        
          
          
          <div class="md-nav__link md-nav__container">
            <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/" class="md-nav__link ">
              
  
  <span class="md-ellipsis">
    开发运维
  </span>
  

            </a>
            
              
              <label class="md-nav__link " for="__nav_5_4" id="__nav_5_4_label" tabindex="">
                <span class="md-nav__icon md-icon"></span>
              </label>
            
          </div>
        
        <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_4_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4">
            <span class="md-nav__icon md-icon"></span>
            开发运维
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_1" >
        
          
          <label class="md-nav__link" for="__nav_5_4_1" id="__nav_5_4_1_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    静态网站
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_1_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_1">
            <span class="md-nav__icon md-icon"></span>
            静态网站
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E9%9D%99%E6%80%81%E7%BD%91%E7%AB%99/2022-11-07-dgw4bs/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    博客 | Hugo 博客使用 Fancybox
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E9%9D%99%E6%80%81%E7%BD%91%E7%AB%99/2022-05-26-biowebstack/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    将重点资源整理成一个生信导航网页
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E9%9D%99%E6%80%81%E7%BD%91%E7%AB%99/2021-12-09-mle18r/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Hugo 不解析 markdown 中的 html 标签
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E9%9D%99%E6%80%81%E7%BD%91%E7%AB%99/2021-09-10-coding-ci-hugo/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    使用腾讯 CODING 托管并自动部署 Hugo 网站
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E9%9D%99%E6%80%81%E7%BD%91%E7%AB%99/2020-12-23-start-coding-pages/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    使用 coding.net 发布你的个人博客
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E9%9D%99%E6%80%81%E7%BD%91%E7%AB%99/2020-12-23-coding-net-custom-domain/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    自定义 coding.net 静态网站域名
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E9%9D%99%E6%80%81%E7%BD%91%E7%AB%99/2020-10-21-cloudbase-note/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    腾讯云 cloudbase 云开发使用笔记
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E9%9D%99%E6%80%81%E7%BD%91%E7%AB%99/2020-09-24-qm3vml/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    CentOS 7 下 Jekyll 环境搭建与应用
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E9%9D%99%E6%80%81%E7%BD%91%E7%AB%99/2019-12-24-fl1z7t/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    博客 | Hugo 博客添加 utterances 评论
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E9%9D%99%E6%80%81%E7%BD%91%E7%AB%99/2019-12-04-coding-pages/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    怎么在 CODING 上部署自己的静态网站
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E9%9D%99%E6%80%81%E7%BD%91%E7%AB%99/2019-08-28-disqus-for-hugo/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    博客 | hugo 博客添加 disqus 评论系统
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E9%9D%99%E6%80%81%E7%BD%91%E7%AB%99/2019-08-08-build-hugo-blogs/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    博客 | Hugo 博客折腾的一些记录
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E9%9D%99%E6%80%81%E7%BD%91%E7%AB%99/2019-08-07-flex-slider-and-raxus-slider/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    FlexSlider 和 RaxusSlider 插件相关参数
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E9%9D%99%E6%80%81%E7%BD%91%E7%AB%99/2019-07-04-leanote-for-ecs-tutorial/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    使用阿里云 ECS 搭建自己的 Leanote 云笔记服务
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E9%9D%99%E6%80%81%E7%BD%91%E7%AB%99/2019-07-04-ecs-docker-wordpress-ssl/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    阿里云 ECS+Docker+WordPress 搭建个人博客
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E9%9D%99%E6%80%81%E7%BD%91%E7%AB%99/2019-06-03-jekyll-add-page-view/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Jekyll 网站添加访问量统计分析
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_2" >
        
          
          <label class="md-nav__link" for="__nav_5_4_2" id="__nav_5_4_2_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    集群
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_2_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_2">
            <span class="md-nav__icon md-icon"></span>
            集群
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E9%9B%86%E7%BE%A4/2019-07-13-hpc-experience-glibc/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    一次胆战心惊的真实集群运维经历
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_3" >
        
          
          <label class="md-nav__link" for="__nav_5_4_3" id="__nav_5_4_3_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    语雀技巧
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_3_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_3">
            <span class="md-nav__icon md-icon"></span>
            语雀技巧
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E8%AF%AD%E9%9B%80%E6%8A%80%E5%B7%A7/2022-12-02-try-yuque-api/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    基于语雀 API 的文档管理探索
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E8%AF%AD%E9%9B%80%E6%8A%80%E5%B7%A7/2019-08-08-sync-from-yuque-to-oss/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    语雀图片的同步迁移解决方案
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_4" >
        
          
          <label class="md-nav__link" for="__nav_5_4_4" id="__nav_5_4_4_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    虚拟环境
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_4_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_4">
            <span class="md-nav__icon md-icon"></span>
            虚拟环境
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E8%99%9A%E6%8B%9F%E7%8E%AF%E5%A2%83/2023-04-19-tkrdu8xnidryrmqa/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    [micro]mamba 学习笔记
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E8%99%9A%E6%8B%9F%E7%8E%AF%E5%A2%83/2020-11-27-conda-tutorial-for-biosoft/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    一文掌握 conda 安装配置生物信息软件
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E8%99%9A%E6%8B%9F%E7%8E%AF%E5%A2%83/2019-12-30-jupyterlab-server-note/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    JupyterLab Server 搭建与使用笔记
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E8%99%9A%E6%8B%9F%E7%8E%AF%E5%A2%83/2019-07-17-jupyter-notebook-toturial-3/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Jupyter Notebook 教程(三)：多语言编程环境配置
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E8%99%9A%E6%8B%9F%E7%8E%AF%E5%A2%83/2019-07-17-jupyter-notebook-toturial-2/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Jupyter Notebook 教程(二)：服务器搭建
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E8%99%9A%E6%8B%9F%E7%8E%AF%E5%A2%83/2019-07-17-jupyter-notebook-toturial-1/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Jupyter Notebook 教程(一)：本地安装与使用
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E8%99%9A%E6%8B%9F%E7%8E%AF%E5%A2%83/2019-07-04-anaconda-experience/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Anaconda 使用的一些体验与困惑
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E8%99%9A%E6%8B%9F%E7%8E%AF%E5%A2%83/2019-07-01-jupyter-notebook-tutorial/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    数据科学工具 Jupyter Notebook 教程
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E8%99%9A%E6%8B%9F%E7%8E%AF%E5%A2%83/2019-07-01-conda-env-roll-back/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    让你的 conda 回滚 到以前版本的环境
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E8%99%9A%E6%8B%9F%E7%8E%AF%E5%A2%83/2019-07-01-cloud-services-for-jupyter-notebook/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    基于云的六大 Jupyter Notebook 平台测评
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E8%99%9A%E6%8B%9F%E7%8E%AF%E5%A2%83/2019-05-27-kgrnx4/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    使用 conda 和 Jupyter 在 R 中实现数据科学分析
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_5" >
        
          
          <label class="md-nav__link" for="__nav_5_4_5" id="__nav_5_4_5_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    系统与编译
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_5_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_5">
            <span class="md-nav__icon md-icon"></span>
            系统与编译
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E7%B3%BB%E7%BB%9F%E4%B8%8E%E7%BC%96%E8%AF%91/2021-09-02-scl-devtoolset-note/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    SCL 笔记 | Devtoolset 安装与使用笔记
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E7%B3%BB%E7%BB%9F%E4%B8%8E%E7%BC%96%E8%AF%91/2021-09-02-rpm-e-openssl/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    服务器崩溃日志之误删 OpenSSL
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E7%B3%BB%E7%BB%9F%E4%B8%8E%E7%BC%96%E8%AF%91/2021-08-31-glibc/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    GLIBC 笔记 | 安装与使用
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E7%B3%BB%E7%BB%9F%E4%B8%8E%E7%BC%96%E8%AF%91/2019-07-01-linux-gcc-install/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    非 root 用户手动编译安装 GCC
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_6" >
        
          
          <label class="md-nav__link" for="__nav_5_4_6" id="__nav_5_4_6_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    知识管理
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_6_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_6">
            <span class="md-nav__icon md-icon"></span>
            知识管理
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E7%9F%A5%E8%AF%86%E7%AE%A1%E7%90%86/2020-08-21-install-confluence-on-centos/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    一个小清新的知识管理和问题讨论平台
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E7%9F%A5%E8%AF%86%E7%AE%A1%E7%90%86/2020-08-04-zwtn5w/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    一个小团队使用的知识管理方案与工具
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E7%9F%A5%E8%AF%86%E7%AE%A1%E7%90%86/2019-09-06-ga7bft/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Gitbook 安装与使用笔记
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E7%9F%A5%E8%AF%86%E7%AE%A1%E7%90%86/2019-07-01-rss-for-top-news/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    使用 RSS 打造你的科研资讯头条
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_7" >
        
          
          <label class="md-nav__link" for="__nav_5_4_7" id="__nav_5_4_7_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    生信工具与应用
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_7_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_7">
            <span class="md-nav__icon md-icon"></span>
            生信工具与应用
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E7%94%9F%E4%BF%A1%E5%B7%A5%E5%85%B7%E4%B8%8E%E5%BA%94%E7%94%A8/2022-12-01-chgoa2xahz44rkld/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    NCBI Blast 源码编译安装方法
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E7%94%9F%E4%BF%A1%E5%B7%A5%E5%85%B7%E4%B8%8E%E5%BA%94%E7%94%A8/2022-09-08-qyp3m9/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    AlphaFold：安装与使用备忘
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E7%94%9F%E4%BF%A1%E5%B7%A5%E5%85%B7%E4%B8%8E%E5%BA%94%E7%94%A8/2022-08-11-vbqgpm/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    使用 wget/curl 下载 GitHub Release 生信软件包
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E7%94%9F%E4%BF%A1%E5%B7%A5%E5%85%B7%E4%B8%8E%E5%BA%94%E7%94%A8/2020-12-15-bcl2fastq-install/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    测序数据学习笔记：bcl2fastq 安装
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E7%94%9F%E4%BF%A1%E5%B7%A5%E5%85%B7%E4%B8%8E%E5%BA%94%E7%94%A8/2020-07-15-tm90c2/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    CentOS 6/7 安装 codon-optimizer 笔记
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E7%94%9F%E4%BF%A1%E5%B7%A5%E5%85%B7%E4%B8%8E%E5%BA%94%E7%94%A8/2019-07-01-pyclone-install/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    癌症克隆种群结构分析软件 PyClone 安装
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E7%94%9F%E4%BF%A1%E5%B7%A5%E5%85%B7%E4%B8%8E%E5%BA%94%E7%94%A8/2019-05-18-pyclone-install-1714572/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    癌症中克隆种群结构统计推断分析软件PyClone安装小记
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E7%94%9F%E4%BF%A1%E5%B7%A5%E5%85%B7%E4%B8%8E%E5%BA%94%E7%94%A8/2019-05-18-kefse-install/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    LEfSe 分析软件安装小记
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_8" >
        
          
          <label class="md-nav__link" for="__nav_5_4_8" id="__nav_5_4_8_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    版本控制
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_8_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_8">
            <span class="md-nav__icon md-icon"></span>
            版本控制
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E7%89%88%E6%9C%AC%E6%8E%A7%E5%88%B6/2021-12-10-github-sync/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    GitHub 代码实时同步至国内 GIT 站点
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E7%89%88%E6%9C%AC%E6%8E%A7%E5%88%B6/2019-09-12-github-fork-update/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    如何同步更新 Github 上 Fork 的项目？
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E7%89%88%E6%9C%AC%E6%8E%A7%E5%88%B6/2019-08-21-github-badge/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    GitHub 的项目徽章
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E7%89%88%E6%9C%AC%E6%8E%A7%E5%88%B6/2019-05-10-git-usage/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    版本控制 Git 使用笔记
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E7%89%88%E6%9C%AC%E6%8E%A7%E5%88%B6/2019-05-09-xpurpl/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    国内 GitHub 访问加速
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_9" >
        
          
          <label class="md-nav__link" for="__nav_5_4_9" id="__nav_5_4_9_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    服务器配置使用
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_9_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_9">
            <span class="md-nav__icon md-icon"></span>
            服务器配置使用
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8/2022-08-18-rhel-9-no-hostkey-alg/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    RHEL6 ssh 到 RHEL9 的 no hostkey alg 错误
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8/2021-10-08-ssh-config/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    SSH 登录与配置
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8/2021-09-30-cvm-migrate2rocky/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    腾讯云/阿里云升级 Rocky Linux
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8/2021-07-19-kaxskc/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    生信服务器基础配置：启动服务
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8/2021-07-07-hydwuq/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    挂载对象存储到 Linux 当本地磁盘
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8/2021-05-27-centos-rhel-6-7-timezone/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    更改 RHEL 6/7 中的时区
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8/2021-02-20-ssl-issues/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    服务器关于 OpenSSL/SSL 的异常处理备忘
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8/2020-12-03-wek7vb/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    NFS 挂载与异常处理知识整理
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8/2020-09-04-history-command/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Linux 中多终端同步 history 记录
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8/2020-06-03-bio-server-basic/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    生信服务器入门级基本设置
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8/2020-05-18-nfs-umount/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    远程挂载 NFS 共享目录引发死机问题
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8/2020-02-21-tar-issues-note/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    tar 打包的一些注意问题
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8/2019-12-03-zks7y7/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Linux 服务器更换主板后，网卡识别失败的处理方法
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8/2019-09-29-linux-acl-permission/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    在 Linux 上给用户赋予指定目录的读写权限
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8/2019-09-23-alyun-change-os/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    阿里云 ECS 更换操作系统
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8/2019-07-25-fedora-redhat-centos/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Fedora Redhat Centos 有什么区别和关系？
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8/2019-07-19-ucig1a/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Linux 下的进程管理
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8/2019-07-19-linux-lvm/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Linux 磁盘管理之 LVM 原理与操作
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8/2019-07-19-linux-lib-env/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Linux 下的动态库、静态库与环境变量
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8/2019-07-01-ssh-attack/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    一次 SSH 攻击与处理记录
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8/2019-07-01-security-for-centos-7/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    CentOS Linux 7 安全基线设置
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8/2019-07-01-centos-firewall/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    生信服务器基本配置：防火墙
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_10" >
        
          
          <label class="md-nav__link" for="__nav_5_4_10" id="__nav_5_4_10_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    服务器安全管理
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_10_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_10">
            <span class="md-nav__icon md-icon"></span>
            服务器安全管理
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%AE%89%E5%85%A8%E7%AE%A1%E7%90%86/2023-05-16-wuxfef4ulf24w1op/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    使用 John The Ripper 破解密码
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%AE%89%E5%85%A8%E7%AE%A1%E7%90%86/2021-08-03-kswapd0/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    服务器又中毒了，得治一治！
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%AE%89%E5%85%A8%E7%AE%A1%E7%90%86/2020-08-25-hpc-autoru/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    一次 HPC 病毒感染与解决经历
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_11" >
        
          
          <label class="md-nav__link" for="__nav_5_4_11" id="__nav_5_4_11_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    文件同步传输
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_11_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_11">
            <span class="md-nav__icon md-icon"></span>
            文件同步传输
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%96%87%E4%BB%B6%E5%90%8C%E6%AD%A5%E4%BC%A0%E8%BE%93/2021-11-08-lrzsz/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    文件传输命令 rz 与 sz 安装与使用
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_12" >
        
          
          <label class="md-nav__link" for="__nav_5_4_12" id="__nav_5_4_12_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    数据库
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_12_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_12">
            <span class="md-nav__icon md-icon"></span>
            数据库
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%95%B0%E6%8D%AE%E5%BA%93/2021-08-18-hgvs-pgsql/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Python 包安装和 postgresql 的一些问题
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%95%B0%E6%8D%AE%E5%BA%93/2021-01-19-guol49/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    配置 SpliceSeq DB，忘记了 MySQL root 密码怎么办？
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E6%95%B0%E6%8D%AE%E5%BA%93/2019-07-01-install-mysql-from-source/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    从 Blast2GO 到 MySQL 源码编译安装
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_13" >
        
          
          <label class="md-nav__link" for="__nav_5_4_13" id="__nav_5_4_13_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    图像与GUI
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_13_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_13">
            <span class="md-nav__icon md-icon"></span>
            图像与GUI
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E5%9B%BE%E5%83%8F%E4%B8%8EGUI/2023-02-13-gkthk7lbm82t1qrl/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    服务器显卡/显卡驱动/GPU/CUDA的一些理解
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E5%9B%BE%E5%83%8F%E4%B8%8EGUI/2022-09-15-xydp3a/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Gnuplot：安装与使用备忘
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E5%9B%BE%E5%83%8F%E4%B8%8EGUI/2020-07-07-learn-imagemagick/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    ImageMagick 图像处理安装与使用
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E5%9B%BE%E5%83%8F%E4%B8%8EGUI/2019-07-01-tkinter-unicode-issues/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Python 中 tkinter 源码安装使用与中文乱码
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E5%9B%BE%E5%83%8F%E4%B8%8EGUI/2019-05-18-redhat-install-pyqt-4/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    RedHat 6.5 下安装 PyQt4 详细步骤
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_14" >
        
          
          <label class="md-nav__link" for="__nav_5_4_14" id="__nav_5_4_14_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    后端
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_14_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_14">
            <span class="md-nav__icon md-icon"></span>
            后端
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E5%90%8E%E7%AB%AF/2021-11-16-301-redirects/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    个人域名跳转至语雀个人主页
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E5%90%8E%E7%AB%AF/2021-02-04-aliyun-ssl-cert/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    阿里云证书套路太深，还是我打开姿势不对？
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E5%90%8E%E7%AB%AF/2020-06-05-pizow4/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    科学上网之部署使用详解
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E5%90%8E%E7%AB%AF/2019-12-23-domain-mail-qq-setting/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    QQ 邮箱设置自定义域名邮箱
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E5%90%8E%E7%AB%AF/2019-07-01-windows-ports/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Windows server 2008 开启端口
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E5%90%8E%E7%AB%AF/2019-07-01-centos-7-nginx-cgi/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    CentOS Linux 7 配置 nginx 支持 CGI
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E5%90%8E%E7%AB%AF/2019-06-01-pypiserver-trial/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    基于 pypiserver 的 PyPI 私有仓库搭建实践
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_15" >
        
          
          <label class="md-nav__link" for="__nav_5_4_15" id="__nav_5_4_15_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    前端
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_15_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_15">
            <span class="md-nav__icon md-icon"></span>
            前端
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E5%89%8D%E7%AB%AF/2021-07-06-tmbu15/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    个人网址导航折腾备忘
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E5%89%8D%E7%AB%AF/2019-12-26-gulp-for-fancybox/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    基于 gulp 的 fancybox 源码压缩
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E5%89%8D%E7%AB%AF/2019-08-23-css-rem/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    前端移动端适配方案之 rem
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E5%89%8D%E7%AB%AF/2019-07-17-google-code-prettify/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Google Code Prettify 代码高亮使用教程
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/%E5%89%8D%E7%AB%AF/2019-06-17-qrtsf1/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Html 垂直多级菜单栏模板
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_17" >
        
          
          <label class="md-nav__link" for="__nav_5_4_17" id="__nav_5_4_17_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    Windows
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_17_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_17">
            <span class="md-nav__icon md-icon"></span>
            Windows
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2023-03-28-0x0000142/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    微信 | 解决企业微信启动报错 0x0000142
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2023-02-21-fg9x7zgnh5vzrycg/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    终端 | Termius 使用体验
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2022-10-13-bz17cy/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    旧版 QQ 邮箱切换到新版本 UI
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2022-05-11-kf71lr/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    推荐 | 中国用户也能同步 Chrome 书签了
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2022-03-03-portx-ssh-client/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    终端 | PortX 使用感受
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2022-02-25-wl23zw/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Win10 | 隐藏图片视频文档等文件夹
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2022-02-15-pwh0lg/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Win10 | 微软输入法快速输入时间
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2022-01-20-my-tools/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    综合 | 我的常用工具和网站
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2022-01-13-mxrwo4/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    终端 | Tabby 使用笔记
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2021-08-25-tebxwh/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Microsoft Edge 的那些事
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2021-04-21-microsoft-edge/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    又爱又恨的 Microsoft Edge！
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2021-03-16-chrome-bookmark-sync/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    使用码云同步谷歌 Chrome 浏览器书签
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2021-02-26-flameshot/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Windows/Linux 下功能强大的桌面截图软件
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2021-02-19-win-font/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    为 Windows 系统替换优雅的苹果字体
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2020-06-17-inpaint/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    一款强大而实用的图片去水印神器
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2020-04-29-hp5ywk/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    微信 | PC 端使用 USB 共享网络备份
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2020-04-17-mc5bkg/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    搜狗输入法的一些使用技巧
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2019-12-24-caiyunapp/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    一款英文文章阅读翻译精品工具
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2019-11-13-obs/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    OBS 录屏的一些配置与使用
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2019-07-17-bugs-of-aliyun-app/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    发现了阿里云 APP 的一个小 BUG
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2019-07-01-ai-logo-desig/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    推荐一个由 AI 生成 LOGO 的网站
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2019-06-28-firefox-quantum/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Firefox Quantum 向左，Google Chrome 向右
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2019-06-26-win-exe-list/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    综合 | Windows 常用软件合集
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2019-05-18-chrome-tutorial/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    chrome 超详细使用教程
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Windows/2019-05-15-pdf-copy/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    扫描版与非扫描版 PDF 文字复制
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_18" >
        
          
          <label class="md-nav__link" for="__nav_5_4_18" id="__nav_5_4_18_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    WebServer
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_18_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_18">
            <span class="md-nav__icon md-icon"></span>
            WebServer
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/WebServer/2019-11-18-centos-install-nginx/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    CentOS 7 下编译安装 Nginx
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_19" >
        
          
          <label class="md-nav__link" for="__nav_5_4_19" id="__nav_5_4_19_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    Singularity
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_19_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_19">
            <span class="md-nav__icon md-icon"></span>
            Singularity
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Singularity/2023-04-18-try-singularity/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Singularity 初探之安装部署与避坑
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_20" >
        
          
          <label class="md-nav__link" for="__nav_5_4_20" id="__nav_5_4_20_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    R
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_20_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_20">
            <span class="md-nav__icon md-icon"></span>
            R
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/R/2021-02-20-r-download-file/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    R 语言 download.file 的几点知识
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/R/2020-06-19-r-download-file-ssl-error/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    R 语言 download.file 的 SSL connect error
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/R/2020-06-11-r-ssl-certificate/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    R 语言关于 SSL 证书异常处理笔记
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/R/2020-06-04-xxli8d/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    RStudio Linux Server 安装配置说明
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/R/2020-05-25-rtools-install-mirrors/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    使用镜像加速 Rtools 下载与安装
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/R/2020-03-05-venneuler-installation/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    UpSetR 关联的 venneuler 包安装笔记
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/R/2020-01-14-ublsz7/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    R 语言中的 X11 相关问题
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/R/2019-07-15-r-ramigo/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    RamiGO 安装及库依赖解决备忘
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/R/2019-07-01-install-latest-r-from-source/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Linux 下 R 源码安装指南
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/R/2019-07-01-bioconductor-packages/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Bioconductor 中的 R 包安装方法总结
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/R/2019-05-25-qznkyp/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    R 软件如何升级
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/R/2019-05-24-nt820f/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    R 软件 openssl 包与 libssl.so.1.0.0 的一个坑
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/R/2019-05-24-dadyai/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    R 软件的 CXX11 is not defined 解决
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_21" >
        
          
          <label class="md-nav__link" for="__nav_5_4_21" id="__nav_5_4_21_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    Python
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_21_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_21">
            <span class="md-nav__icon md-icon"></span>
            Python
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Python/2020-05-09-uninstall-setup-py/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    如何卸载 python setup.py install 安装的包？
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Python/2019-05-18-python-enable-shared/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    聊一聊 Python 安装中的 --enable-shared
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Python/2019-05-18-install-python-from-source/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Python 源码编译安装
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_22" >
        
          
          <label class="md-nav__link" for="__nav_5_4_22" id="__nav_5_4_22_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    Perl
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_22_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_22">
            <span class="md-nav__icon md-icon"></span>
            Perl
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Perl/2020-06-19-how-to-install-perl-modules/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    各个平台下 Perl 模块安装总结
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Perl/2019-07-01-install-perl-from-source/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    各个平台下 Perl 源码安装教程
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_23" >
        
          
          <label class="md-nav__link" for="__nav_5_4_23" id="__nav_5_4_23_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    LaTeX
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_23_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_23">
            <span class="md-nav__icon md-icon"></span>
            LaTeX
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/LaTeX/2020-02-10-linux-install-fonts/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Linux 字体安装
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/LaTeX/2019-07-01-latex-2018-tutorial/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    LaTeX 安装教程
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_24" >
        
          
          <label class="md-nav__link" for="__nav_5_4_24" id="__nav_5_4_24_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    IDE
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_24_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_24">
            <span class="md-nav__icon md-icon"></span>
            IDE
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/IDE/2021-11-12-xmanager-power-suite-7/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Xmanager 7 客户端安装与使用说明
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/IDE/2021-11-11-md2x-editor/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Md2X Editor | 一个专注于微信公众号 Markdown 排版的平台
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/IDE/2020-04-21-mobaxterm-installation/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    MobaXterm 客户端安装说明
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/IDE/2019-07-01-webterminal-for-linux/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    基于 Web 的 Linux 终端 WebTerminal
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/IDE/2019-07-01-vscode-remote-ssh/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    VSCode 中利用 Remote SSH 连接远程服务器
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/IDE/2019-07-01-irf3na/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Windows 全能终端神器 MobaXterm
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/IDE/2019-06-21-vscode-usage/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    VS Code 常见配置与使用技巧总结
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/IDE/2019-05-18-how-to-use-vim/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Vim 使用的一些小技巧
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4_25" >
        
          
          <label class="md-nav__link" for="__nav_5_4_25" id="__nav_5_4_25_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    Docker
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_4_25_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_4_25">
            <span class="md-nav__icon md-icon"></span>
            Docker
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Docker/2021-06-10-docker-ngs/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    使用 Docker 分析高通量测序数据
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%BC%80%E5%8F%91%E8%BF%90%E7%BB%B4/Docker/2021-06-03-recover-hub-account/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    终于把 7 年前的 Docker Hub 账号恢复了
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
    
  
  
  
    
    
      
        
          
        
      
        
      
        
      
        
      
        
      
        
      
    
    
    
    
      
      
    
    <li class="md-nav__item md-nav__item--active md-nav__item--section md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_5" checked>
        
          
          
          <div class="md-nav__link md-nav__container">
            <a href="../../" class="md-nav__link ">
              
  
  <span class="md-ellipsis">
    编程技术
  </span>
  

            </a>
            
              
              <label class="md-nav__link " for="__nav_5_5" id="__nav_5_5_label" tabindex="">
                <span class="md-nav__icon md-icon"></span>
              </label>
            
          </div>
        
        <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_5_label" aria-expanded="true">
          <label class="md-nav__title" for="__nav_5_5">
            <span class="md-nav__icon md-icon"></span>
            编程技术
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_5_2" >
        
          
          <label class="md-nav__link" for="__nav_5_5_2" id="__nav_5_5_2_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    Shell
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_5_2_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_5_2">
            <span class="md-nav__icon md-icon"></span>
            Shell
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../Shell/2022-09-09-screen/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    多重视窗管理程序 screen
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../Shell/2020-12-03-xvwc74/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Linux fuser 命令详解
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../Shell/2020-04-17-mv-skill/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    使用 mv 重命名文件无需两次键入文件名称
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../Shell/2020-02-13-shell-shift-note/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Linux shift 命令用法笔记
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../Shell/2020-01-13-shell-coding/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Linux shell 编程笔记
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_5_3" >
        
          
          <label class="md-nav__link" for="__nav_5_5_3" id="__nav_5_5_3_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    R
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_5_3_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_5_3">
            <span class="md-nav__icon md-icon"></span>
            R
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../R/2020-03-18-tallkr/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    R 函数 | cumsum 函数笔记
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../R/2020-02-27-r-fonts/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    R 语言画图中英文字体解决方案
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../R/2019-12-05-lwsgg0/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    R 常用操作汇总
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../R/2019-10-19-uoepud/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    R 语言中的高级图像处理包
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../R/2019-07-01-r-packages-guide/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    R 包初学者指南
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
    
  
  
  
    
    
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--active md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_5_4" checked>
        
          
          <label class="md-nav__link" for="__nav_5_5_4" id="__nav_5_5_4_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    Python
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_5_4_label" aria-expanded="true">
          <label class="md-nav__title" for="__nav_5_5_4">
            <span class="md-nav__icon md-icon"></span>
            Python
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../2023-03-14-hsco916i48bzedk7/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Python 中添加环境变量
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../2022-05-20-python-3-types-in-the-wild/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    失控的 Python3 类型
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../2022-04-21-ipython-magics/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    IPython 内置魔法命令
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../2022-04-19-gqksoi/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Python 类型与编码转换
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../2021-12-07-plf2lq/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Python Excel 操作 | Openpyxl 模块笔记
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../2020-02-18-xlrd-xlwt-notes/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Python Excel 操作 | xlrd+xlwt 模块笔记
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../2019-10-16-pcfnsd/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Cool New Features in Python 3.8
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../2019-09-21-how-to-use-datetime-in-python/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Python 日期和时间函数使用指南
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../2019-09-19-xu2eg5/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Python 文件下载并显示下载进度条
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
    
  
  
  
    <li class="md-nav__item md-nav__item--active">
      
      <input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
      
      
        
      
      
      <a href="./" class="md-nav__link md-nav__link--active">
        
  
  <span class="md-ellipsis">
    Python 文件与目录操作方法总结
  </span>
  

      </a>
      
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../2019-06-11-iddn10/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Python 读取大文件
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../2019-05-21-kzicg7/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Python 执行 shell 命令
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../2019-05-18-python-os-path/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    python3 中 os.path 模块常用用法总结
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../2019-05-18-python-match/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Python 正则匹配总结
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../2019-05-18-python-list-dict-tuple-skills/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Python 的列表/字典/元组技巧
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_5_5" >
        
          
          <label class="md-nav__link" for="__nav_5_5_5" id="__nav_5_5_5_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    Perl
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_5_5_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_5_5">
            <span class="md-nav__icon md-icon"></span>
            Perl
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../Perl/2021-08-27-ec2340/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    Perl 程序编写101
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_5_6" >
        
          
          <label class="md-nav__link" for="__nav_5_5_6" id="__nav_5_5_6_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    Go
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_5_6_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_5_6">
            <span class="md-nav__icon md-icon"></span>
            Go
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../Go/2019-09-18-ygzmzn/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    GO 学习资料
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
          
        
      
        
      
    
    
    
    
      
      
    
    <li class="md-nav__item md-nav__item--section md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_6" >
        
          
          
          <div class="md-nav__link md-nav__container">
            <a href="../../../%E6%95%B0%E6%8D%AE%E5%BA%93/" class="md-nav__link ">
              
  
  <span class="md-ellipsis">
    数据库
  </span>
  

            </a>
            
              
              <label class="md-nav__link " for="__nav_5_6" id="__nav_5_6_label" tabindex="">
                <span class="md-nav__icon md-icon"></span>
              </label>
            
          </div>
        
        <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_6_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_6">
            <span class="md-nav__icon md-icon"></span>
            数据库
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
            
              
                
  
  
  
  
    
    
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_6_2" >
        
          
          <label class="md-nav__link" for="__nav_5_6_2" id="__nav_5_6_2_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    PostgreSQL
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_6_2_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_6_2">
            <span class="md-nav__icon md-icon"></span>
            PostgreSQL
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E6%95%B0%E6%8D%AE%E5%BA%93/PostgreSQL/2019-09-30-pgsql-usage/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    PostgreSQL 常用命令
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
          
        
      
        
      
        
      
    
    
    
    
      
      
    
    <li class="md-nav__item md-nav__item--section md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_7" >
        
          
          
          <div class="md-nav__link md-nav__container">
            <a href="../../../%E5%8F%AF%E8%A7%86%E5%8C%96/" class="md-nav__link ">
              
  
  <span class="md-ellipsis">
    可视化
  </span>
  

            </a>
            
              
              <label class="md-nav__link " for="__nav_5_7" id="__nav_5_7_label" tabindex="">
                <span class="md-nav__icon md-icon"></span>
              </label>
            
          </div>
        
        <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_7_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_7">
            <span class="md-nav__icon md-icon"></span>
            可视化
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_7_2" >
        
          
          <label class="md-nav__link" for="__nav_5_7_2" id="__nav_5_7_2_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    R语言可视化
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_7_2_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_7_2">
            <span class="md-nav__icon md-icon"></span>
            R语言可视化
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%8F%AF%E8%A7%86%E5%8C%96/R%E8%AF%AD%E8%A8%80%E5%8F%AF%E8%A7%86%E5%8C%96/2020-05-25-covid-19-shiny-apps/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    如何在 5 分钟内建立一个数据驱动的新型冠状病毒肺炎应用程序
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%8F%AF%E8%A7%86%E5%8C%96/R%E8%AF%AD%E8%A8%80%E5%8F%AF%E8%A7%86%E5%8C%96/2020-05-20-ggplot_plot_margin/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    ggplot2 调整绘图区域大小
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%8F%AF%E8%A7%86%E5%8C%96/R%E8%AF%AD%E8%A8%80%E5%8F%AF%E8%A7%86%E5%8C%96/2020-03-19-ggplot2-piechart-note/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    温故而知新，学习一下 ggplot2 饼图
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%8F%AF%E8%A7%86%E5%8C%96/R%E8%AF%AD%E8%A8%80%E5%8F%AF%E8%A7%86%E5%8C%96/2019-07-01-r-gganatogram/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    基于 ggplot2 的解剖图和组织模块可视化
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
              
                
  
  
  
  
    
    
      
        
      
        
      
    
    
    
    
    <li class="md-nav__item md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_7_3" >
        
          
          <label class="md-nav__link" for="__nav_5_7_3" id="__nav_5_7_3_label" tabindex="0">
            
  
  <span class="md-ellipsis">
    Python可视化
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_5_7_3_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_5_7_3">
            <span class="md-nav__icon md-icon"></span>
            Python可视化
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%8F%AF%E8%A7%86%E5%8C%96/Python%E5%8F%AF%E8%A7%86%E5%8C%96/2022-02-24-how-to-use-ggplot2-in-python/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    如何在 Python 中使用 ggplot2？
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../%E5%8F%AF%E8%A7%86%E5%8C%96/Python%E5%8F%AF%E8%A7%86%E5%8C%96/2019-10-12-tp85x1/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    基于 Dash Bio 的生物信息学数据可视化
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

    
      
      
  
  
  
  
    
    
      
        
          
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
        
      
    
    
    
    
      
      
    
    <li class="md-nav__item md-nav__item--section md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6" >
        
          
          
          <div class="md-nav__link md-nav__container">
            <a href="../../../../note/" class="md-nav__link ">
              
  
  <span class="md-ellipsis">
    随笔
  </span>
  

            </a>
            
              
              <label class="md-nav__link " for="__nav_6" id="__nav_6_label" tabindex="">
                <span class="md-nav__icon md-icon"></span>
              </label>
            
          </div>
        
        <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_6">
            <span class="md-nav__icon md-icon"></span>
            随笔
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2023-06-05-ava/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    战地之王
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2023-06-02-hot-hot-hot/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    热成狗
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2023-05-10-find-my-pkm/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    心目中完美的知识管理工具
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2023-04-12-mp2yq/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    公众号与语雀
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2023-03-16-do2zxwm9qv3uta33/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    精致
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2023-02-15-ibgpiv1ucvta5o73/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    羽毛球
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2023-02-07-all-in-yuque/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    All in Yuque
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2023-01-12-summary-2022/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    2022 语雀年度报告
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2022-12-21-covid-19-202212/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    新冠那点事
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2022-12-19-qatar-world-cup-2022/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    2022 年卡塔尔世界杯
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2022-11-02-note-note/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    笔记的那些事
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2022-03-25-lfcpn2/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    清明节前，狂风暴雨时
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2022-01-10-domain-magic/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    域名碎碎念
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2022-01-01-happy-new-year-2022/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    2022，虎年春节，吉祥团圆
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2021-12-31-my-2021/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    2021 年年终总结
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2021-11-18-pinyin-sogou/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    搜狗拼音输入法
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2021-10-14-yuque-vip/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    语雀天使
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2021-09-30-kl4dca/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    语雀目录的一些困惑
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2021-09-22-mid-autumn-trip/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    2021 中秋之行
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2021-07-21-ycpgag/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    肘关节骨折
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2021-06-16-gz-covid-19/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    疫情下的广州
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2021-05-06-bbnxbn/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    五一喜与乐
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2021-04-23-wl2kww/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    电子产品魔怔
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2020-12-31-happy-2020/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    2020 年年终总结
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2020-08-20-qqmvht/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    逛博客
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2020-07-14-vyymes/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    吐槽一下公众号的那些事
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2020-03-20-amvh8c/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    手续费和年利率
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2020-03-16-rz7c3n/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    大牛
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2020-03-13-whnegc/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    语雀知识库文档分类的纠结
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2020-01-16-pct5pb/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    吐槽一下微信公众号的赞赏号
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2019-12-13-kblu4x/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    动了谁的奶酪
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2019-12-04-housing/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    广州萝岗大壮公寓出租
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2019-11-28-chicken-soup/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    心灵鸡汤
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2019-11-06-writing/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    写作与初衷
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2019-10-16-input/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    输入法，哪一个才是我的菜？
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2019-09-04-marriage-art/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    婚姻修养
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2019-08-26-a-real-man/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    一个纯粹的人
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2019-08-19-moc049/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    沉默的大多数
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2019-07-23-coding-cancel-account/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    不提供账号注销等于耍流氓
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2019-07-08-unicom-broadband/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    联通宽带
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2019-07-08-to-be-good/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    你若安好便是晴天
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2019-07-01-focus-on-writing/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    只要能坚持下来就是好博客
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2019-05-29-blogs-and-sites-collected/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    一些博客与站点搜集
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../note/2019-04-29-funny-name/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    一些好玩的命名风格
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

    
      
      
  
  
  
  
    
    
      
        
          
        
      
    
    
    
    
      
      
    
    <li class="md-nav__item md-nav__item--section md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_7" >
        
          
          
          <div class="md-nav__link md-nav__container">
            <a href="../../../../message/" class="md-nav__link ">
              
  
  <span class="md-ellipsis">
    留言
  </span>
  

            </a>
            
          </div>
        
        <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_7_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_7">
            <span class="md-nav__icon md-icon"></span>
            留言
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
            
          </ul>
        </nav>
      
    </li>
  

    
      
      
  
  
  
  
    
    
      
        
          
        
      
        
      
        
      
    
    
    
    
      
      
    
    <li class="md-nav__item md-nav__item--section md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_8" >
        
          
          
          <div class="md-nav__link md-nav__container">
            <a href="../../../../readme/" class="md-nav__link ">
              
  
  <span class="md-ellipsis">
    关于
  </span>
  

            </a>
            
              
              <label class="md-nav__link " for="__nav_8" id="__nav_8_label" tabindex="">
                <span class="md-nav__icon md-icon"></span>
              </label>
            
          </div>
        
        <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_8_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_8">
            <span class="md-nav__icon md-icon"></span>
            关于
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../readme/work/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    开源作品
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../../../readme/res/" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    常用资源
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

    
      
      
  
  
  
  
    
    
      
        
          
        
      
    
    
    
    
      
      
    
    <li class="md-nav__item md-nav__item--section md-nav__item--nested">
      
        
        
        
        <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_9" >
        
          
          
          <div class="md-nav__link md-nav__container">
            <a href="../../../../flinks/" class="md-nav__link ">
              
  
  <span class="md-ellipsis">
    友链
  </span>
  

            </a>
            
          </div>
        
        <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_9_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_9">
            <span class="md-nav__icon md-icon"></span>
            友链
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
            
          </ul>
        </nav>
      
    </li>
  

    
      
      
  
  
  
  
    <li class="md-nav__item">
      <a href="https://weiyan.cc/feed_rss_created.xml" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    RSS
  </span>
  

      </a>
    </li>
  

    
  </ul>
</nav>
                  </div>
                </div>
              </div>
            
            
              
              <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
                <div class="md-sidebar__scrollwrap">
                  <div class="md-sidebar__inner">
                    

<nav class="md-nav md-nav--secondary" aria-label="目录">
  
  
  
    
  
  
</nav>
                  </div>
                </div>
              </div>
            
          
          
            <div class="md-content" data-md-component="content">
              <article class="md-content__inner md-typeset">
                
                  

  
    <a href="https://github.com/shenweiyan/ShenLab-CN/edit/main/docs/yuque/编程技术/Python/2019-07-01-python-file-directory-toturial.md" title="编辑此页" class="md-content__button md-icon">
      
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 20H6V4h7v5h5v3.1l2-2V8l-6-6H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h4v-2m10.2-7c.1 0 .3.1.4.2l1.3 1.3c.2.2.2.6 0 .8l-1 1-2.1-2.1 1-1c.1-.1.2-.2.4-.2m0 3.9L14.1 23H12v-2.1l6.1-6.1 2.1 2.1Z"/></svg>
    </a>
  
  
    
      
    
    <a href="https://github.com/shenweiyan/ShenLab-CN/raw/main/docs/yuque/编程技术/Python/2019-07-01-python-file-directory-toturial.md" title="查看本页的源代码" class="md-content__button md-icon">
      
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 18c.56 0 1 .44 1 1s-.44 1-1 1-1-.44-1-1 .44-1 1-1m0-3c-2.73 0-5.06 1.66-6 4 .94 2.34 3.27 4 6 4s5.06-1.66 6-4c-.94-2.34-3.27-4-6-4m0 6.5a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1 2.5-2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1-2.5 2.5M9.27 20H6V4h7v5h5v4.07c.7.08 1.36.25 2 .49V8l-6-6H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h4.5a8.15 8.15 0 0 1-1.23-2Z"/></svg>
    </a>
  


<p>Python 有很多内置的模块和函数可用于文件的操作处理，这些函数都分布在几个模块上：如 <code>os</code>，<code>os.path</code>，<code>shutil</code> 和<code>pathlib</code> 等等。本文收集了许多您需要知道的函数，以便在 Python 中对文件执行最常见的操作。</p>
<p>通过本教程，你可以：</p>
<ul>
<li>检索文件属性</li>
</ul>
<p>Retrieve file properties</p>
<ul>
<li>创建目录</li>
</ul>
<p>Create directories</p>
<ul>
<li>基于文件名的模式匹配</li>
</ul>
<p>Match patterns in filenames</p>
<ul>
<li>遍历目录树</li>
</ul>
<p>Traverse directory trees</p>
<ul>
<li>创建临时文件和目录</li>
</ul>
<p>Make temporary files and directories</p>
<ul>
<li>删除文件和目录</li>
</ul>
<p>Delete files and directories</p>
<ul>
<li>拷贝、转移、重命名文件和目录</li>
</ul>
<p>Copy, move, or rename files and directories</p>
<ul>
<li>创建和提取 ZI P 和 TAR 打包</li>
</ul>
<p>Create and extract ZIP and TAR archives</p>
<ul>
<li>使用 <code>fileinput</code>  模块打开多个文件</li>
</ul>
<p>Open multiple files using the fileinput module</p>
<hr />
<h1 id="python-读写数据到文件">Python 读写数据到文件<a class="headerlink" href="#python-读写数据到文件" title="Permanent link">&para;</a></h1>
<p>使用 Python 读取和写入文件数据非常简单。 为此，我们必须首先以适当的模式打开文件。 以下是如何打开文本文件并读取其内容的示例：</p>
<div class="highlight"><pre><span></span><code><span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s1">&#39;data.txt&#39;</span><span class="p">,</span> <span class="s1">&#39;r&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
    <span class="n">data</span> <span class="o">=</span> <span class="n">f</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
</code></pre></div>
<p><code>open()</code> 接受文件名和模式作为参数。 <code>r</code> 是以只读模式打开文件。如果要将数据写入文件，请将<code>w</code>作为参数传入：</p>
<div class="highlight"><pre><span></span><code><span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s1">&#39;data.txt&#39;</span><span class="p">,</span> <span class="s1">&#39;w&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
    <span class="n">data</span> <span class="o">=</span> <span class="s1">&#39;some data to be written to the file&#39;</span>
    <span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
</code></pre></div>
<p>在上面的示例中，<code>open()</code> 打开用于读取或写入的文件，并返回文件句柄（在本例中为 <code>f</code>），该句柄提供可用于读取或写入文件数据的方法。 更多有关如何读取和写入文件的更多信息，参考：<a href="https://dbader.org/blog/python-file-io">Working With File I/O in Python </a>。</p>
<hr />
<h1 id="获取目录列表">获取目录列表<a class="headerlink" href="#获取目录列表" title="Permanent link">&para;</a></h1>
<p>假设您当前的工作目录有一个名为 my_directory 的子目录，其中包含以下内容：</p>
<div class="highlight"><pre><span></span><code><span class="o">.</span>
<span class="err">├──</span> <span class="n">file1</span><span class="o">.</span><span class="n">py</span>
<span class="err">├──</span> <span class="n">file2</span><span class="o">.</span><span class="n">csv</span>
<span class="err">├──</span> <span class="n">file3</span><span class="o">.</span><span class="n">txt</span>
<span class="err">├──</span> <span class="n">sub_dir</span>
<span class="err">│</span>   <span class="err">├──</span> <span class="n">bar</span><span class="o">.</span><span class="n">py</span>
<span class="err">│</span>   <span class="err">└──</span> <span class="n">foo</span><span class="o">.</span><span class="n">py</span>
<span class="err">├──</span> <span class="n">sub_dir_b</span>
<span class="err">│</span>   <span class="err">└──</span> <span class="n">file4</span><span class="o">.</span><span class="n">txt</span>
<span class="err">└──</span> <span class="n">sub_dir_c</span>
    <span class="err">├──</span> <span class="n">config</span><span class="o">.</span><span class="n">py</span>
    <span class="err">└──</span> <span class="n">file5</span><span class="o">.</span><span class="n">txt</span>
</code></pre></div>
<p>内置的<code>os</code>模块有许多有用的功能，可用于列出目录内容并过滤结果。 要获取文件系统中特定目录下的所有文件和文件夹的列表，请在旧版本的 Python 中使用<code>os.listdir()</code>；或在 Python 3.x 中使用<code>os.scandir()</code>。 如果你还想获取文件和目录属性（如文件大小和修改日期），则<code>os.scandir()</code>是首选方法。</p>
<h2 id="在传统-python-版本中获取目录列表">在传统 Python 版本中获取目录列表<a class="headerlink" href="#在传统-python-版本中获取目录列表" title="Permanent link">&para;</a></h2>
<p>在 Python 3 之前的 Python 版本中，<code>os.listdir()</code> 是用于获取目录列表的方法：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="kn">import</span> <span class="nn">os</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">entries</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">listdir</span><span class="p">(</span><span class="s1">&#39;my_directory/&#39;</span><span class="p">)</span>
</code></pre></div>
<p><code>os.listdir()</code> 返回一个 Python 列表，其中包含 path 参数下目录中的文件和子目录的名称：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">os</span><span class="o">.</span><span class="n">listdir</span><span class="p">(</span><span class="s1">&#39;my_directory/&#39;</span><span class="p">)</span>
<span class="p">[</span><span class="s1">&#39;sub_dir_c&#39;</span><span class="p">,</span> <span class="s1">&#39;file1.py&#39;</span><span class="p">,</span> <span class="s1">&#39;sub_dir_b&#39;</span><span class="p">,</span> <span class="s1">&#39;file3.txt&#39;</span><span class="p">,</span> <span class="s1">&#39;file2.csv&#39;</span><span class="p">,</span> <span class="s1">&#39;sub_dir&#39;</span><span class="p">]</span>
</code></pre></div>
<p>像这样列出的目录列表不容易阅读。使用循环打印出对<code>os.listdir()</code>的调用输出，有助于(后续的目录和文件)清理：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">entries</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">listdir</span><span class="p">(</span><span class="s1">&#39;my_directory/&#39;</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span> <span class="k">for</span> <span class="n">entry</span> <span class="ow">in</span> <span class="n">entries</span><span class="p">:</span>
<span class="o">...</span>     <span class="nb">print</span><span class="p">(</span><span class="n">entry</span><span class="p">)</span>
<span class="o">...</span>
<span class="o">...</span>
<span class="n">sub_dir_c</span>
<span class="n">file1</span><span class="o">.</span><span class="n">py</span>
<span class="n">sub_dir_b</span>
<span class="n">file3</span><span class="o">.</span><span class="n">txt</span>
<span class="n">file2</span><span class="o">.</span><span class="n">csv</span>
<span class="n">sub_dir</span>
</code></pre></div>
<h2 id="在现代-python-版本中的获取目录列表">在现代 Python 版本中的获取目录列表<a class="headerlink" href="#在现代-python-版本中的获取目录列表" title="Permanent link">&para;</a></h2>
<p>在现代版本的 Python 中，<code>os.listdir()</code>的替代方法是使用<code>os.scandir()</code>和<code>pathlib.Path()</code>。</p>
<p><code>os.scandir()</code> 是在 Python 3.5 中引入的，并在 <a href="https://www.python.org/dev/peps/pep-0471/">PEP 471</a> 中有记录。<code>os.scandir()</code>在调用时返回一个迭代器(iterator)而不是列表：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="kn">import</span> <span class="nn">os</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">entries</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">scandir</span><span class="p">(</span><span class="s1">&#39;my_directory/&#39;</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">entries</span>
<span class="o">&lt;</span><span class="n">posix</span><span class="o">.</span><span class="n">ScandirIterator</span> <span class="nb">object</span> <span class="n">at</span> <span class="mh">0x7f5b047f3690</span><span class="o">&gt;</span>
</code></pre></div>
<p><code>ScandirIterator</code>  对象指向当前目录中的所有条目。我们可以遍历迭代器的内容并打印出文件名：</p>
<div class="highlight"><pre><span></span><code>import os

with os.scandir(&#39;my_directory/&#39;) as entries:
    for entry in entries:
        print(entry.name)
</code></pre></div>
<p>在这里，<code>os.scandir()</code>与<code>with</code>语句一起使用，因为它支持上下文管理器协议（the context manager protocol）。 使用上下文管理器可以关闭迭代器并在迭代器耗尽后自动释放获取的资源。 结果是打印出 my_directory 中的文件名，就像在<code>os.listdir()</code>示例中看到的那样：</p>
<div class="highlight"><pre><span></span><code><span class="n">sub_dir_c</span>
<span class="n">file1</span><span class="o">.</span><span class="n">py</span>
<span class="n">sub_dir_b</span>
<span class="n">file3</span><span class="o">.</span><span class="n">txt</span>
<span class="n">file2</span><span class="o">.</span><span class="n">csv</span>
<span class="n">sub_dir</span>
</code></pre></div>
<p>获取目录列表的另一种方法是使用<code>pathlib</code>模块：</p>
<div class="highlight"><pre><span></span><code><span class="kn">from</span> <span class="nn">pathlib</span> <span class="kn">import</span> <span class="n">Path</span>

<span class="n">entries</span> <span class="o">=</span> <span class="n">Path</span><span class="p">(</span><span class="s1">&#39;my_directory/&#39;</span><span class="p">)</span>
<span class="k">for</span> <span class="n">entry</span> <span class="ow">in</span> <span class="n">entries</span><span class="o">.</span><span class="n">iterdir</span><span class="p">():</span>
    <span class="nb">print</span><span class="p">(</span><span class="n">entry</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
</code></pre></div>
<p><code>Path</code> 方法返回的对象是 PosixPath 或 WindowsPath 对象，具体取决于操作系统。</p>
<p><code>pathlib.Path()</code>对象具有<code>.iterdir()</code>方法，用于创建目录中所有文件和文件夹的迭代器。 由<code>.iterdir()</code>生成的每个条目都包含有关文件或目录的信息，例如其名称和文件属性。<code>pathlib</code>最初是在 Python 3.4 中引入的，是 Python 的一个很好的补充，它为文件系统提供了面向对象的接口。</p>
<p>在上面的示例中，我们调用<code>pathlib.Path()</code>并将路径参数传递给它。接下来是调用<code>.iterdir()</code>来获取 my_directory 中所有文件和目录的列表。</p>
<p><code>pathlib</code>提供了一组类，它们以简单，面向对象的方式展现了基于路径的大多数常见操作。 使用<code>pathlib</code>比使用<code>os</code>中的函数更有效。 使用<code>pathlib</code> 相比于<code>os</code>的另一个好处是它减少了操作文件系统路径时所需的导入数量。更多相关信息，请阅读：<a href="https://realpython.com/python-pathlib/">Python 3’s pathlib Module: Taming the File System</a>。</p>
<p>运行上面的代码会产生以下结果：</p>
<div class="highlight"><pre><span></span><code>sub_dir_c
file1.py
sub_dir_b
file3.txt
file2.csv
sub_dir
</code></pre></div>
<p>使用<code>pathlib.Path()</code>或<code>os.scandir()</code>而不是<code>os.listdir()</code>是获取目录列表的首选方法，尤其是在处理需要文件类型和文件属性信息的代码时。 <code>pathlib.Path()</code>提供了<code>os</code>和<code>shutil</code>中的大部分文件和路径处理功能，它的方法比这些模块中的方法更有效。 接下来我们将讨论如何快速获取文件属性。</p>
<p>以下是目录列表功能：</p>
<p><a class="glightbox" href="https://shub.weiyan.tech/yuque/elog-cookbook-img/FkAzAEk1Qnh6fnc4B0W8wFblUsj_.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="" src="https://shub.weiyan.tech/yuque/elog-cookbook-img/FkAzAEk1Qnh6fnc4B0W8wFblUsj_.png" /></a></p>
<p>这些函数返回了一个包含了目录中所有内容的列表，包括子目录。这些操作可能并不总是您想要的。下一节我们将介绍如何从目录列表中进行结果过滤。</p>
<h2 id="列出目录中的所有文件">列出目录中的所有文件<a class="headerlink" href="#列出目录中的所有文件" title="Permanent link">&para;</a></h2>
<p>本节将向您展示如何使用<code>os.listdir()</code>，<code>os.scandir()</code>和<code>pathlib.Path()</code>打印出目录中文件的名称。 如果我们要过滤目录并仅列出由<code>os.listdir()</code>得到的目录列表中的文件，请使用<code>os.path</code>：</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">os</span>

<span class="c1"># List all files in a directory using os.listdir</span>
<span class="n">basepath</span> <span class="o">=</span> <span class="s1">&#39;my_directory/&#39;</span>
<span class="k">for</span> <span class="n">entry</span> <span class="ow">in</span> <span class="n">os</span><span class="o">.</span><span class="n">listdir</span><span class="p">(</span><span class="n">basepath</span><span class="p">):</span>
    <span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isfile</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">basepath</span><span class="p">,</span> <span class="n">entry</span><span class="p">)):</span>
        <span class="nb">print</span><span class="p">(</span><span class="n">entry</span><span class="p">)</span>
</code></pre></div>
<p>在这里，对<code>os.listdir()</code>的调用返回了指定路径中的所有内容列表，然后使用<code>os.path.isfile()</code>过滤该列表，只打印出文件而不是目录。这会产生以下输出：</p>
<div class="highlight"><pre><span></span><code>file1.py
file3.txt
file2.csv
</code></pre></div>
<p>列出目录中文件的一个更简单方法是使用<code>os.scandir()</code>或<code>pathlib.Path()</code>：</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">os</span>

<span class="c1"># List all files in a directory using scandir()</span>
<span class="n">basepath</span> <span class="o">=</span> <span class="s1">&#39;my_directory/&#39;</span>
<span class="k">with</span> <span class="n">os</span><span class="o">.</span><span class="n">scandir</span><span class="p">(</span><span class="n">basepath</span><span class="p">)</span> <span class="k">as</span> <span class="n">entries</span><span class="p">:</span>
    <span class="k">for</span> <span class="n">entry</span> <span class="ow">in</span> <span class="n">entries</span><span class="p">:</span>
        <span class="k">if</span> <span class="n">entry</span><span class="o">.</span><span class="n">is_file</span><span class="p">():</span>
            <span class="nb">print</span><span class="p">(</span><span class="n">entry</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
</code></pre></div>
<p>使用<code>os.scandir()</code>比使用<code>os.listdir()</code>具有更清晰，更容易理解的优点，即使它是一行更长的代码。如果对象是文件，则对 ScandirIterator 中的每个 item 调用 <code>entry.is_file()</code> 将返回<code>True</code>的结果。打印出目录中所有文件的名称可以得到以下输出：</p>
<div class="highlight"><pre><span></span><code>file1.py
file3.txt
file2.csv
</code></pre></div>
<p>以下是使用<code>pathlib.Path()</code>列出目录中文件的方法：</p>
<div class="highlight"><pre><span></span><code><span class="kn">from</span> <span class="nn">pathlib</span> <span class="kn">import</span> <span class="n">Path</span>

<span class="n">basepath</span> <span class="o">=</span> <span class="n">Path</span><span class="p">(</span><span class="s1">&#39;my_directory/&#39;</span><span class="p">)</span>
<span class="n">files_in_basepath</span> <span class="o">=</span> <span class="n">basepath</span><span class="o">.</span><span class="n">iterdir</span><span class="p">()</span>
<span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">files_in_basepath</span><span class="p">:</span>
    <span class="k">if</span> <span class="n">item</span><span class="o">.</span><span class="n">is_file</span><span class="p">():</span>
        <span class="nb">print</span><span class="p">(</span><span class="n">item</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
</code></pre></div>
<p>在这里，我们在<code>.iterdir()</code>产生的每个 item 上调用<code>.is_file()</code>。 产生的输出是相同的：</p>
<div class="highlight"><pre><span></span><code>file1.py
file3.txt
file2.csv
</code></pre></div>
<p>如果将 for 循环和 if 语句组合成单个生成器表达式，则上面的代码可以更简洁。 Dan Bader 有一篇关于生成器表达式（<a href="https://dbader.org/blog/python-generator-expressions">generator expressions</a>）和列表推导（list comprehensions）的优秀文章，感兴趣的可以去看一下。</p>
<p>上面的代码，经修改后的版本如下所示：</p>
<div class="highlight"><pre><span></span><code><span class="kn">from</span> <span class="nn">pathlib</span> <span class="kn">import</span> <span class="n">Path</span>

<span class="c1"># List all files in directory using pathlib</span>
<span class="n">basepath</span> <span class="o">=</span> <span class="n">Path</span><span class="p">(</span><span class="s1">&#39;my_directory/&#39;</span><span class="p">)</span>
<span class="n">files_in_basepath</span> <span class="o">=</span> <span class="p">(</span><span class="n">entry</span> <span class="k">for</span> <span class="n">entry</span> <span class="ow">in</span> <span class="n">basepath</span><span class="o">.</span><span class="n">iterdir</span><span class="p">()</span> <span class="k">if</span> <span class="n">entry</span><span class="o">.</span><span class="n">is_file</span><span class="p">())</span>
<span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">files_in_basepath</span><span class="p">:</span>
    <span class="nb">print</span><span class="p">(</span><span class="n">item</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
</code></pre></div>
<p>这将产生与之前的示例完全相同的输出。本节展示了使用<code>os.scandir()</code>和<code>pathlib.Path()</code>过滤文件或目录，它们比使用<code>os.listdir()</code>和<code>os.path</code>更直观，看起来更干净。</p>
<h2 id="列出子目录">列出子目录<a class="headerlink" href="#列出子目录" title="Permanent link">&para;</a></h2>
<p>要列出子目录而不是文件，请使用以下方法之一。</p>
<p>如何使用<code>os.listdir()</code>和<code>os.path()</code>：</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">os</span>

<span class="c1"># List all subdirectories using os.listdir</span>
<span class="n">basepath</span> <span class="o">=</span> <span class="s1">&#39;my_directory/&#39;</span>
<span class="k">for</span> <span class="n">entry</span> <span class="ow">in</span> <span class="n">os</span><span class="o">.</span><span class="n">listdir</span><span class="p">(</span><span class="n">basepath</span><span class="p">):</span>
    <span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">basepath</span><span class="p">,</span> <span class="n">entry</span><span class="p">)):</span>
        <span class="nb">print</span><span class="p">(</span><span class="n">entry</span><span class="p">)</span>
</code></pre></div>
<p>当您多次调用<code>os.path.join()</code>时，以这种方式操作文件系统路径很快就会变得很麻烦。在我的计算机上运行它会产生以下输出：</p>
<div class="highlight"><pre><span></span><code>sub_dir_c
sub_dir_b
sub_dir
</code></pre></div>
<p>如何使用<code>os.scandir()</code>：</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">os</span>

<span class="c1"># List all subdirectories using scandir()</span>
<span class="n">basepath</span> <span class="o">=</span> <span class="s1">&#39;my_directory/&#39;</span>
<span class="k">with</span> <span class="n">os</span><span class="o">.</span><span class="n">scandir</span><span class="p">(</span><span class="n">basepath</span><span class="p">)</span> <span class="k">as</span> <span class="n">entries</span><span class="p">:</span>
    <span class="k">for</span> <span class="n">entry</span> <span class="ow">in</span> <span class="n">entries</span><span class="p">:</span>
        <span class="k">if</span> <span class="n">entry</span><span class="o">.</span><span class="n">is_dir</span><span class="p">():</span>
            <span class="nb">print</span><span class="p">(</span><span class="n">entry</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
</code></pre></div>
<p>与文件列表示例中一样，此处在<code>os.scandir()</code>返回的每个条目上调用<code>.is_dir()</code>。 如果条目是目录，则<code>.is_dir()</code>返回<code>True</code>，并打印出目录的名称。输出与上面相同：</p>
<div class="highlight"><pre><span></span><code>sub_dir_c
sub_dir_b
sub_dir
</code></pre></div>
<p>如何使用<code>pathlib.Path()</code>：</p>
<div class="highlight"><pre><span></span><code><span class="kn">from</span> <span class="nn">pathlib</span> <span class="kn">import</span> <span class="n">Path</span>

<span class="c1"># List all subdirectory using pathlib</span>
<span class="n">basepath</span> <span class="o">=</span> <span class="n">Path</span><span class="p">(</span><span class="s1">&#39;my_directory/&#39;</span><span class="p">)</span>
<span class="k">for</span> <span class="n">entry</span> <span class="ow">in</span> <span class="n">basepath</span><span class="o">.</span><span class="n">iterdir</span><span class="p">():</span>
    <span class="k">if</span> <span class="n">entry</span><span class="o">.</span><span class="n">is_dir</span><span class="p">():</span>
        <span class="nb">print</span><span class="p">(</span><span class="n">entry</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
</code></pre></div>
<p>本示例在 basepath 迭代器的每个条目上调用<code>.is_dir()</code>检查条目是文件还是目录 如果条目是目录，则将其名称打印到屏幕上。本示例输出与上一示例中的输出相同：</p>
<div class="highlight"><pre><span></span><code>sub_dir_c
sub_dir_b
sub_dir
</code></pre></div>
<h1 id="获取文件属性">获取文件属性<a class="headerlink" href="#获取文件属性" title="Permanent link">&para;</a></h1>
<p>Python 可以轻松检索文件大小和修改时间等文件属性。这是通过<code>os.stat()</code>，<code>os.scandir()</code>或<code>pathlib.Path()</code>完成的。</p>
<p><code>os.scandir()</code>和<code>pathlib.Path()</code>检索具有文件属性组合的目录列表。这可能比使用<code>os.listdir()</code>列出文件然后获取每个文件的文件属性信息更有效。</p>
<p>下面的示例显示了如何获取 my_directory 中文件的上次修改时间。输出以秒为单位：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="kn">import</span> <span class="nn">os</span>
<span class="o">&gt;&gt;&gt;</span> <span class="k">with</span> <span class="n">os</span><span class="o">.</span><span class="n">scandir</span><span class="p">(</span><span class="s1">&#39;my_directory/&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">dir_contents</span><span class="p">:</span>
<span class="o">...</span>     <span class="k">for</span> <span class="n">entry</span> <span class="ow">in</span> <span class="n">dir_contents</span><span class="p">:</span>
<span class="o">...</span>         <span class="n">info</span> <span class="o">=</span> <span class="n">entry</span><span class="o">.</span><span class="n">stat</span><span class="p">()</span>
<span class="o">...</span>         <span class="nb">print</span><span class="p">(</span><span class="n">info</span><span class="o">.</span><span class="n">st_mtime</span><span class="p">)</span>
<span class="o">...</span>
<span class="mf">1539032199.0052035</span>
<span class="mf">1539032469.6324475</span>
<span class="mf">1538998552.2402923</span>
<span class="mf">1540233322.4009316</span>
<span class="mf">1537192240.0497339</span>
<span class="mf">1540266380.3434134</span>
</code></pre></div>
<p><code>os.scandir()</code>返回一个 ScandirIterator 对象。ScandirIterator 对象中的每个条目都有一个<code>.stat()</code>方法，用于检索有关其指向的文件或目录的信息。<code>.stat()</code>提供文件大小和上次修改时间等信息。在上面的示例中，代码打印出 st_mtime 属性，该属性是上次修改文件内容的时间。</p>
<p><code>pathlib</code> 模块也具有相应的方法，用于检索提供相同结果的文件信息：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="kn">from</span> <span class="nn">pathlib</span> <span class="kn">import</span> <span class="n">Path</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">current_dir</span> <span class="o">=</span> <span class="n">Path</span><span class="p">(</span><span class="s1">&#39;my_directory&#39;</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span> <span class="k">for</span> <span class="n">path</span> <span class="ow">in</span> <span class="n">current_dir</span><span class="o">.</span><span class="n">iterdir</span><span class="p">():</span>
<span class="o">...</span>     <span class="n">info</span> <span class="o">=</span> <span class="n">path</span><span class="o">.</span><span class="n">stat</span><span class="p">()</span>
<span class="o">...</span>     <span class="nb">print</span><span class="p">(</span><span class="n">info</span><span class="o">.</span><span class="n">st_mtime</span><span class="p">)</span>
<span class="o">...</span>
<span class="mf">1539032199.0052035</span>
<span class="mf">1539032469.6324475</span>
<span class="mf">1538998552.2402923</span>
<span class="mf">1540233322.4009316</span>
<span class="mf">1537192240.0497339</span>
<span class="mf">1540266380.3434134</span>
</code></pre></div>
<p>在上面的示例中，代码循环遍历<code>.iterdir()</code>返回的对象，并通过<code>.stat()</code>调用为目录列表中的每个文件检索其文件属性。<code>st_mtime</code> 属性返回了一个浮点值，表示自纪元以来的秒数。如果想要转换 <code>st_mtime</code> 返回的值以用于更直观的展示，我们可以编写一个辅助函数来将秒转换为 <code>datetime</code>对象：</p>
<div class="highlight"><pre><span></span><code><span class="kn">from</span> <span class="nn">datetime</span> <span class="kn">import</span> <span class="n">datetime</span>
<span class="kn">from</span> <span class="nn">os</span> <span class="kn">import</span> <span class="n">scandir</span>

<span class="k">def</span> <span class="nf">convert_date</span><span class="p">(</span><span class="n">timestamp</span><span class="p">):</span>
    <span class="n">d</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">utcfromtimestamp</span><span class="p">(</span><span class="n">timestamp</span><span class="p">)</span>
    <span class="n">formated_date</span> <span class="o">=</span> <span class="n">d</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s1">&#39;</span><span class="si">%d</span><span class="s1"> %b %Y&#39;</span><span class="p">)</span>
    <span class="k">return</span> <span class="n">formated_date</span>

<span class="k">def</span> <span class="nf">get_files</span><span class="p">():</span>
    <span class="n">dir_entries</span> <span class="o">=</span> <span class="n">scandir</span><span class="p">(</span><span class="s1">&#39;my_directory/&#39;</span><span class="p">)</span>
    <span class="k">for</span> <span class="n">entry</span> <span class="ow">in</span> <span class="n">dir_entries</span><span class="p">:</span>
        <span class="k">if</span> <span class="n">entry</span><span class="o">.</span><span class="n">is_file</span><span class="p">():</span>
            <span class="n">info</span> <span class="o">=</span> <span class="n">entry</span><span class="o">.</span><span class="n">stat</span><span class="p">()</span>
            <span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="n">entry</span><span class="o">.</span><span class="n">name</span><span class="si">}</span><span class="se">\t</span><span class="s1"> Last Modified: </span><span class="si">{</span><span class="n">convert_date</span><span class="p">(</span><span class="n">info</span><span class="o">.</span><span class="n">st_mtime</span><span class="p">)</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">)</span>
</code></pre></div>
<p>这将首先获取 my_directory 中的文件列表及其属性，然后调用<code>convert_date()</code>将每个文件的上次修改时间转换为人类可读的形式。 <code>convert_date()</code>使用<code>.strftime()</code>将时间（以秒为单位）转换为字符串。</p>
<p>传递给<code>.strftime()</code>的参数如下：</p>
<ul>
<li>%d：the day of the month</li>
<li>%b：the month, in abbreviated form</li>
<li>%Y：the year</li>
</ul>
<p>这些指令整合到一起产生如下所示的输出：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">get_files</span><span class="p">()</span>
<span class="n">file1</span><span class="o">.</span><span class="n">py</span>        <span class="n">Last</span> <span class="n">modified</span><span class="p">:</span>  <span class="mi">04</span> <span class="n">Oct</span> <span class="mi">2018</span>
<span class="n">file3</span><span class="o">.</span><span class="n">txt</span>       <span class="n">Last</span> <span class="n">modified</span><span class="p">:</span>  <span class="mi">17</span> <span class="n">Sep</span> <span class="mi">2018</span>
<span class="n">file2</span><span class="o">.</span><span class="n">txt</span>       <span class="n">Last</span> <span class="n">modified</span><span class="p">:</span>  <span class="mi">17</span> <span class="n">Sep</span> <span class="mi">2018</span>
</code></pre></div>
<p>将日期和时间转换为字符串的语法可能非常混乱。要了解更多信息，请查看相关的<a href="https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior">官方文档</a>。或者参考另一个更易于记忆的方法：<a href="http://strftime.org/">http://strftime.org/</a>。</p>
<h1 id="创建目录">创建目录<a class="headerlink" href="#创建目录" title="Permanent link">&para;</a></h1>
<p>我们编写的程序需要创建目录以便在其中存储数据时，可以参考<code>os</code>和<code>pathlib</code>中包含用于创建目录的函数。</p>
<p><a class="glightbox" href="https://shub.weiyan.tech/yuque/elog-cookbook-img/FmQolOuA8sSrkClyR9VM6f6sYjnQ.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="" src="https://shub.weiyan.tech/yuque/elog-cookbook-img/FmQolOuA8sSrkClyR9VM6f6sYjnQ.png" /></a></p>
<h2 id="创建单个目录">创建单个目录<a class="headerlink" href="#创建单个目录" title="Permanent link">&para;</a></h2>
<p>要创建单个目录，请将目录路径作为参数传递给<code>os.mkdir()</code>：</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">os</span>

<span class="n">os</span><span class="o">.</span><span class="n">mkdir</span><span class="p">(</span><span class="s1">&#39;example_directory/&#39;</span><span class="p">)</span>
</code></pre></div>
<p>如果目录已存在，<code>os.mkdir()</code>会引发<code>FileExistsError</code>。或者，我们可以使用<code>pathlib</code>创建目录：</p>
<div class="highlight"><pre><span></span><code><span class="kn">from</span> <span class="nn">pathlib</span> <span class="kn">import</span> <span class="n">Path</span>

<span class="n">p</span> <span class="o">=</span> <span class="n">Path</span><span class="p">(</span><span class="s1">&#39;example_directory/&#39;</span><span class="p">)</span>
<span class="n">p</span><span class="o">.</span><span class="n">mkdir</span><span class="p">()</span>
</code></pre></div>
<p>如果路径已经存在，<code>mkdir()</code>会引发<code>FileExistsError</code>：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">p</span><span class="o">.</span><span class="n">mkdir</span><span class="p">()</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
  <span class="n">File</span> <span class="s1">&#39;&lt;stdin&gt;&#39;</span><span class="p">,</span> <span class="n">line</span> <span class="mi">1</span><span class="p">,</span> <span class="ow">in</span> <span class="o">&lt;</span><span class="n">module</span><span class="o">&gt;</span>
  <span class="n">File</span> <span class="s1">&#39;/usr/lib/python3.5/pathlib.py&#39;</span><span class="p">,</span> <span class="n">line</span> <span class="mi">1214</span><span class="p">,</span> <span class="ow">in</span> <span class="n">mkdir</span>
    <span class="bp">self</span><span class="o">.</span><span class="n">_accessor</span><span class="o">.</span><span class="n">mkdir</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mode</span><span class="p">)</span>
  <span class="n">File</span> <span class="s1">&#39;/usr/lib/python3.5/pathlib.py&#39;</span><span class="p">,</span> <span class="n">line</span> <span class="mi">371</span><span class="p">,</span> <span class="ow">in</span> <span class="n">wrapped</span>
    <span class="k">return</span> <span class="n">strfunc</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">pathobj</span><span class="p">),</span> <span class="o">*</span><span class="n">args</span><span class="p">)</span>
<span class="ne">FileExistsError</span><span class="p">:</span> <span class="p">[</span><span class="n">Errno</span> <span class="mi">17</span><span class="p">]</span> <span class="n">File</span> <span class="n">exists</span><span class="p">:</span> <span class="s1">&#39;.&#39;</span>
<span class="p">[</span><span class="n">Errno</span> <span class="mi">17</span><span class="p">]</span> <span class="n">File</span> <span class="n">exists</span><span class="p">:</span> <span class="s1">&#39;.&#39;</span>
</code></pre></div>
<p>为了避免这样的错误，可以在错误发生时捕获错误并让用户知道：</p>
<div class="highlight"><pre><span></span><code><span class="kn">from</span> <span class="nn">pathlin</span> <span class="n">Path</span>

<span class="n">p</span> <span class="o">=</span> <span class="n">Path</span><span class="p">(</span><span class="s1">&#39;example_directory&#39;</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
    <span class="n">p</span><span class="o">.</span><span class="n">mkdir</span><span class="p">()</span>
<span class="k">except</span> <span class="ne">FileExistsError</span> <span class="k">as</span> <span class="n">exc</span><span class="p">:</span>
    <span class="nb">print</span><span class="p">(</span><span class="n">exc</span><span class="p">)</span>
</code></pre></div>
<p>或者，我们也可以通过将<code>exist_ok = True</code>参数传递给<code>.mkdir()</code>来忽略<code>FileExistsError</code>：</p>
<div class="highlight"><pre><span></span><code><span class="kn">from</span> <span class="nn">pathlib</span> <span class="kn">import</span> <span class="n">Path</span>

<span class="n">p</span> <span class="o">=</span> <span class="n">Path</span><span class="p">(</span><span class="s1">&#39;example_directory&#39;</span><span class="p">)</span>
<span class="n">p</span><span class="o">.</span><span class="n">mkdir</span><span class="p">(</span><span class="n">exist_ok</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
</code></pre></div>
<p>这样一来，如果目录已存在，则不会引发错误。</p>
<h2 id="创建多个目录">创建多个目录<a class="headerlink" href="#创建多个目录" title="Permanent link">&para;</a></h2>
<p><code>os.makedirs()</code>类似于<code>os.mkdir()</code>。两者之间的区别在于，<code>os.makedirs()</code>不仅可以创建单独的目录，还可以用于创建目录树。换句话说，它可以创建任何必要的中间文件夹，以确保存在完整路径。</p>
<p><code>os.makedirs()</code>类似于在 Bash 中运行<code>mkdir -p</code>。例如，要创建一组目录，如<code>2018/10/05</code>，您只需执行以下操作：</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">os</span>

<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="s1">&#39;2018/10/05&#39;</span><span class="p">)</span>
</code></pre></div>
<p>这将创建一个包含文件夹 2018，10 和 05 的嵌套目录结构：</p>
<div class="highlight"><pre><span></span><code><span class="o">.</span>
<span class="err">└──</span> <span class="mi">2018</span>
    <span class="err">└──</span> <span class="mi">10</span>
        <span class="err">└──</span> <span class="mi">05</span>
</code></pre></div>
<p><code>.makedirs()</code>使用默认权限创建目录。如果要创建具有不同权限的目录，我们需要在调用<code>.makedirs()</code>时并传入我们希望在以下位置创建目录的模式：</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">os</span>

<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="s1">&#39;2018/10/05&#39;</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="mo">0o770</span><span class="p">)</span>
</code></pre></div>
<p>这将创建 2018/10/05 目录结构，并为所有者和组用户提供读、写和执行权限。默认模式为<code>0o777</code>，并且不更改现有父目录的文件权限位。有关文件权限以及模式应用方式的更多详细信息，请参阅<a href="https://docs.python.org/3/library/os.html#os.makedirs">文档</a>。</p>
<p>执行 <code>tree</code>  的 shell 命令以确认已应用正确的权限：</p>
<div class="highlight"><pre><span></span><code>$<span class="w"> </span>tree<span class="w"> </span>-p<span class="w"> </span>-i<span class="w"> </span>.
.
<span class="o">[</span>drwxrwx---<span class="o">]</span><span class="w">  </span><span class="m">2018</span>
<span class="o">[</span>drwxrwx---<span class="o">]</span><span class="w">  </span><span class="m">10</span>
<span class="o">[</span>drwxrwx---<span class="o">]</span><span class="w">  </span><span class="m">05</span>
</code></pre></div>
<p>这将打印出当前目录的目录树。<code>tree</code>通常用于以树状格式列出目录的内容。 将<code>-p</code>和<code>-i</code>参数传递给它会在垂直列表中打印出目录名称及其文件权限信息。<code>-p</code>打印出文件权限，<code>-i</code>使树生成一个没有缩进行的垂直列表。</p>
<p>如我们所见，所有目录都拥有<code>770</code>权限。创建目录的另一种方法是使用<code>pathlib.Path</code>中的<code>.mkdir()</code>：</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">pathlib</span>

<span class="n">p</span> <span class="o">=</span> <span class="n">pathlib</span><span class="o">.</span><span class="n">Path</span><span class="p">(</span><span class="s1">&#39;2018/10/05&#39;</span><span class="p">)</span>
<span class="n">p</span><span class="o">.</span><span class="n">mkdir</span><span class="p">(</span><span class="n">parents</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
</code></pre></div>
<p>将<code>parents = True</code>传递给<code>Path.mkdir()</code>会使其创建目录<code>05</code>以及使路径有效所需的任何父目录。</p>
<p>默认情况下，如果目标目录已存在，<code>os.makedirs()</code>和<code>Path.mkdir()</code>会引发<code>OSError</code>。通过在调用每个函数时传递<code>exist_ok = True</code>作为关键字参数，可以覆盖此行为（从 Python 3.2 开始）。</p>
<p>运行上面的代码会产生一个像下面一样的目录结构：</p>
<div class="highlight"><pre><span></span><code>.
└──<span class="w"> </span><span class="m">2018</span>
<span class="w">    </span>└──<span class="w"> </span><span class="m">10</span>
<span class="w">        </span>└──<span class="w"> </span><span class="m">05</span>
</code></pre></div>
<p>我更喜欢在创建目录时使用<code>pathlib</code>，因为我可以使用相同的函数来创建单个或嵌套目录。</p>
<h1 id="文件名模式匹配">文件名模式匹配<a class="headerlink" href="#文件名模式匹配" title="Permanent link">&para;</a></h1>
<p>使用上述方法之一获取目录中的文件列表后，您很可能希望搜索与特定模式匹配的文件。</p>
<p>这些是可以使用的方法和功能：</p>
<ul>
<li><code>endswith()</code> and <code>startswith()</code> string methods</li>
<li><code>fnmatch.fnmatch()</code></li>
<li><code>glob.glob()</code></li>
<li><code>pathlib.Path.glob()</code></li>
</ul>
<p>本节中的示例将在名为 some_directory 的目录上执行，该目录具有以下结构：</p>
<div class="highlight"><pre><span></span><code>.
├──<span class="w"> </span>admin.py
├──<span class="w"> </span>data_01_backup.txt
├──<span class="w"> </span>data_01.txt
├──<span class="w"> </span>data_02_backup.txt
├──<span class="w"> </span>data_02.txt
├──<span class="w"> </span>data_03_backup.txt
├──<span class="w"> </span>data_03.txt
├──<span class="w"> </span>sub_dir
│<span class="w">   </span>├──<span class="w"> </span>file1.py
│<span class="w">   </span>└──<span class="w"> </span>file2.py
└──<span class="w"> </span>tests.py

<span class="m">1</span><span class="w"> </span>directory,<span class="w"> </span><span class="m">10</span><span class="w"> </span>files
</code></pre></div>
<p>如果您正在使用 Bash shell，则可以使用以下命令创建上述目录结构：</p>
<div class="highlight"><pre><span></span><code>$<span class="w"> </span>mkdir<span class="w"> </span>some_directory
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>some_directory/
$<span class="w"> </span>mkdir<span class="w"> </span>sub_dir
$<span class="w"> </span>touch<span class="w"> </span>sub_dir/file1.py<span class="w"> </span>sub_dir/file2.py
$<span class="w"> </span>touch<span class="w"> </span>data_<span class="o">{</span><span class="m">01</span>..03<span class="o">}</span>.txt<span class="w"> </span>data_<span class="o">{</span><span class="m">01</span>..03<span class="o">}</span>_backup.txt<span class="w"> </span>admin.py<span class="w"> </span>tests.py
</code></pre></div>
<p>这将创建 some_directory/ 目录，进入该目录，然后创建 sub_dir。第 4 行是在 sub_dir 中创建 file1.py 和 file2.py，最后一行使用扩展创建所有其他文件。 要了解有关 shell 扩展的更多信息，请访问此<a href="http://linuxcommand.org/lc3_lts0080.php">站点</a>。</p>
<h2 id="使用字符串方法">使用字符串方法<a class="headerlink" href="#使用字符串方法" title="Permanent link">&para;</a></h2>
<p>Python 有几种用于修改和操作字符串的内置方法。当您在文件名中使用搜索模式时，其中两个方法<code>.startswith()</code> 和<code>.endswith()</code>非常有用。为此，首先获取目录列表，然后迭代它：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="kn">import</span> <span class="nn">os</span>

<span class="o">&gt;&gt;&gt;</span> <span class="c1"># Get .txt files</span>
<span class="o">&gt;&gt;&gt;</span> <span class="k">for</span> <span class="n">f_name</span> <span class="ow">in</span> <span class="n">os</span><span class="o">.</span><span class="n">listdir</span><span class="p">(</span><span class="s1">&#39;some_directory&#39;</span><span class="p">):</span>
<span class="o">...</span>     <span class="k">if</span> <span class="n">f_name</span><span class="o">.</span><span class="n">endswith</span><span class="p">(</span><span class="s1">&#39;.txt&#39;</span><span class="p">):</span>
<span class="o">...</span>         <span class="nb">print</span><span class="p">(</span><span class="n">f_name</span><span class="p">)</span>
</code></pre></div>
<p>上面的代码找到 <code>some_directory/</code>中的所有文件，迭代它们并使用<code>.endswith()</code>打印出具有<code>.txt</code>文件扩展名的文件名：sh</p>
<div class="highlight"><pre><span></span><code>data_01.txt
data_03.txt
data_03_backup.txt
data_02_backup.txt
data_02.txt
data_01_backup.txt
</code></pre></div>
<h2 id="使用-fnmatch-进行简单文件名模式匹配">使用 fnmatch 进行简单文件名模式匹配<a class="headerlink" href="#使用-fnmatch-进行简单文件名模式匹配" title="Permanent link">&para;</a></h2>
<p>字符串方法的匹配能力有限。但 <code>fnmatch</code> 具有更高级的模式匹配功能和方法。 <code>fnmatch.fnmatch()</code> 是一个支持使用 * 和 ？ 等通配符的函数。例如，要使用<code>fnmatch</code>查找目录中的所有<code>.txt</code>文件：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="kn">import</span> <span class="nn">os</span>
<span class="o">&gt;&gt;&gt;</span> <span class="kn">import</span> <span class="nn">fnmatch</span>

<span class="o">&gt;&gt;&gt;</span> <span class="k">for</span> <span class="n">file_name</span> <span class="ow">in</span> <span class="n">os</span><span class="o">.</span><span class="n">listdir</span><span class="p">(</span><span class="s1">&#39;some_directory/&#39;</span><span class="p">):</span>
<span class="o">...</span>     <span class="k">if</span> <span class="n">fnmatch</span><span class="o">.</span><span class="n">fnmatch</span><span class="p">(</span><span class="n">file_name</span><span class="p">,</span> <span class="s1">&#39;*.txt&#39;</span><span class="p">):</span>
<span class="o">...</span>         <span class="nb">print</span><span class="p">(</span><span class="n">file_name</span><span class="p">)</span>
</code></pre></div>
<p>这将迭代<code>some_directory</code>中的文件列表，并使用<code>.fnmatch()</code>对具有<code>.txt</code>扩展名的文件执行通配符搜索。</p>
<h2 id="更高级的模式匹配">更高级的模式匹配<a class="headerlink" href="#更高级的模式匹配" title="Permanent link">&para;</a></h2>
<p>假设我们要查找符合特定条件的<code>.txt</code>文件。例如，我们可能只想查找包含单词<code>data</code>的<code>.txt</code>文件，匹配一组下划线之间的数字，或者文件名中的包含单词 <code>backup</code>。 类似于<code>data_01_backup</code>，<code>data_02_backup</code>或<code>data_03_backup</code>的东西。</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="k">for</span> <span class="n">filename</span> <span class="ow">in</span> <span class="n">os</span><span class="o">.</span><span class="n">listdir</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">):</span>
<span class="o">...</span>     <span class="k">if</span> <span class="n">fnmatch</span><span class="o">.</span><span class="n">fnmatch</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="s1">&#39;data_*_backup.txt&#39;</span><span class="p">):</span>
<span class="o">...</span>         <span class="nb">print</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span>
</code></pre></div>
<p>在此处，仅打印与数据<code>_*_ backup.txt</code>模式匹配的文件的名称。模式中的星号将匹配任何字符，因此运行以上代码将查找其文件名中以单词<code>data</code>开头并以<code>backup.txt</code>结尾的所有文本文件，如下面的输出所示：</p>
<div class="highlight"><pre><span></span><code>data_03_backup.txt
data_02_backup.txt
data_01_backup.txt
</code></pre></div>
<h2 id="使用-glob-的文件名模式匹配">使用 glob 的文件名模式匹配<a class="headerlink" href="#使用-glob-的文件名模式匹配" title="Permanent link">&para;</a></h2>
<p>模式匹配的另一个有用模块是  <code>glob</code>。</p>
<p><code>glob</code>模块中<code>的.glob()</code>作用就像<code>fnmatch.fnmatch()</code>一样，但与<code>fnmatch.fnmatch()</code>不同的是，它把以句点（.）为开头的文件当作特殊的文件进行处理。</p>
<p>UNIX 和相关的系统使用 ？ 和 * 通配符来把名称模式转化成文件列表。这称为通配。</p>
<p>例如，在 UNIX shell 中键入<code>mv *.py python_files/</code>会将所有具有<code>.py</code>扩展名的文件从当前目录移动（mv）到目录<code>python_files</code>。 <code>*</code>字符是通配符，表示&rdquo;任意数量的字符&rdquo;，<code>*.py</code>是<code>glob</code>模式匹配。 Windows 操作系统中不提供此 shell 功能。但<code>glob</code>模块在 Python 中添加了此功能，使 Windows 程序也能够使用此功能。</p>
<p>这是一个如何使用<code>glob</code>搜索当前目录中所有 Python（<code>.py</code>）源文件的示例：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="kn">import</span> <span class="nn">glob</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">glob</span><span class="o">.</span><span class="n">glob</span><span class="p">(</span><span class="s1">&#39;*.py&#39;</span><span class="p">)</span>
<span class="p">[</span><span class="s1">&#39;admin.py&#39;</span><span class="p">,</span> <span class="s1">&#39;tests.py&#39;</span><span class="p">]</span>
</code></pre></div>
<p><code>glob.glob ('*。py')</code>搜索当前目录中具有<code>.py</code>扩展名的所有文件，并将它们作为列表返回。 <code>glob</code>还支持 shell 样式的通配符来匹配模式：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="kn">import</span> <span class="nn">glob</span>
<span class="o">&gt;&gt;&gt;</span> <span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">glob</span><span class="o">.</span><span class="n">glob</span><span class="p">(</span><span class="s1">&#39;*[0-9]*.txt&#39;</span><span class="p">):</span>
<span class="o">...</span>     <span class="nb">print</span><span class="p">(</span><span class="n">name</span><span class="p">)</span>
</code></pre></div>
<p>这将查找文件名中包含数字的所有文本（.txt）文件：</p>
<div class="highlight"><pre><span></span><code>data_01.txt
data_03.txt
data_03_backup.txt
data_02_backup.txt
data_02.txt
data_01_backup.txt
</code></pre></div>
<p><code>glob</code>也可以轻松地在子目录中递归搜索文件：</p>
<div class="highlight"><pre><span></span><code>&gt;&gt;&gt; import glob
&gt;&gt;&gt; for file in glob.iglob(&#39;**/*.py&#39;, recursive=True):
...     print(file)
</code></pre></div>
<p>此示例使用<code>glob.iglob()</code>来搜索当前目录和子目录中的<code>.py</code>文件。并通过传递<code>recursive = True</code>作为<code>.iglob()</code>的参数使其搜索当前目录和任何子目录中的<code>.py</code>文件。 其中<code>glob.iglob()</code>和<code>glob.glob()</code>之间的区别在于<code>.iglob()</code>返回迭代器而不是列表。</p>
<p>运行上面的程序会产生以下结果：</p>
<div class="highlight"><pre><span></span><code>admin.py
tests.py
sub_dir/file1.py
sub_dir/file2.py
</code></pre></div>
<p><code>pathlib</code>包含用于获取灵活文件列表的类似方法。 下面的示例显示了如何使用<code>.Path.glob()</code>列出了文件类型是以字母 p 为开头的文件：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="kn">from</span> <span class="nn">pathlib</span> <span class="kn">import</span> <span class="n">Path</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">p</span> <span class="o">=</span> <span class="n">Path</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span> <span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">p</span><span class="o">.</span><span class="n">glob</span><span class="p">(</span><span class="s1">&#39;*.p*&#39;</span><span class="p">):</span>
<span class="o">...</span>     <span class="nb">print</span><span class="p">(</span><span class="n">name</span><span class="p">)</span>

<span class="n">admin</span><span class="o">.</span><span class="n">py</span>
<span class="n">scraper</span><span class="o">.</span><span class="n">py</span>
<span class="n">docs</span><span class="o">.</span><span class="n">pdf</span>
</code></pre></div>
<p>调用<code>p.glob('*.p*')</code>将返回一个生成器对象，该对象指向当前目录中以文件扩展名中的字母 p 开头的所有文件。</p>
<p><code>Path.glob()</code>类似于上面讨论的<code>os.glob()</code>。 正如我们所看到的，<code>pathlib</code>将<code>os</code>，<code>os.path</code>和<code>glob</code>模块的许多最佳功能组合到一个模块中，这使得使用起来非常愉快。</p>
<p>回顾一下，这是我们在本节中介绍的功能表：</p>
<p><a class="glightbox" href="https://shub.weiyan.tech/yuque/elog-cookbook-img/FqqflHxqAIGJBSNRO6nOgjnwmruW.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="" src="https://shub.weiyan.tech/yuque/elog-cookbook-img/FqqflHxqAIGJBSNRO6nOgjnwmruW.png" /></a></p>
<h1 id="遍历目录和文件">遍历目录和文件<a class="headerlink" href="#遍历目录和文件" title="Permanent link">&para;</a></h1>
<p>遍历目录树并处理树中的文件是最常见的编程任务之一。 让我们来探索如何使用内置的 Python 函数 <code>os.walk()</code> 来实现这一点。<code>os.walk()</code>用于通过从上到下或从下到上的遍历来生成目录树中的文件名。出于本节的目的，我们将操作以下目录树：</p>
<div class="highlight"><pre><span></span><code>.
<span class="p">|</span>
├──<span class="w"> </span>folder_1/
<span class="p">|</span><span class="w">   </span>├──<span class="w"> </span>file1.py
<span class="p">|</span><span class="w">   </span>├──<span class="w"> </span>file2.py
<span class="p">|</span><span class="w">   </span>└──<span class="w"> </span>file3.py
<span class="p">|</span>
├──<span class="w"> </span>folder_2/
<span class="p">|</span><span class="w">   </span>├──<span class="w"> </span>file4.py
<span class="p">|</span><span class="w">   </span>├──<span class="w"> </span>file5.py
<span class="p">|</span><span class="w">   </span>└──<span class="w"> </span>file6.py
<span class="p">|</span>
├──<span class="w"> </span>test1.txt
└──<span class="w"> </span>test2.txt
</code></pre></div>
<p>以下是一个示例，演示如何使用<code>os.walk()</code>列出目录树中的所有文件和目录。</p>
<p><code>os.walk()</code>默认以自上而下的方式遍历目录：</p>
<div class="highlight"><pre><span></span><code><span class="c1"># Walking a directory tree and printing the names of the directories and files</span>
<span class="k">for</span> <span class="n">dirpath</span><span class="p">,</span> <span class="n">dirnames</span><span class="p">,</span> <span class="n">files</span> <span class="ow">in</span> <span class="n">os</span><span class="o">.</span><span class="n">walk</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">):</span>
    <span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;Found directory: </span><span class="si">{</span><span class="n">dirpath</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">)</span>
    <span class="k">for</span> <span class="n">file_name</span> <span class="ow">in</span> <span class="n">files</span><span class="p">:</span>
        <span class="nb">print</span><span class="p">(</span><span class="n">file_name</span><span class="p">)</span>
</code></pre></div>
<p><code>os.walk()</code>在每次的循环迭代中返回三个值：</p>
<ul>
<li>当前文件夹的名称。</li>
<li>当前文件夹中的文件夹列表。</li>
<li>当前文件夹中的文件列表。</li>
</ul>
<p>在每次迭代时，它会打印出它找到的子目录和文件的名称：</p>
<div class="highlight"><pre><span></span><code>Found directory: .
test1.txt
test2.txt
Found directory: ./folder_1
file1.py
file3.py
file2.py
Found directory: ./folder_2
file4.py
file5.py
file6.py
</code></pre></div>
<p>要以自下而上的方式遍历目录树，需要将<code>topdown = False</code>关键字参数传递给<code>os.walk()</code>：</p>
<div class="highlight"><pre><span></span><code><span class="k">for</span> <span class="n">dirpath</span><span class="p">,</span> <span class="n">dirnames</span><span class="p">,</span> <span class="n">files</span> <span class="ow">in</span> <span class="n">os</span><span class="o">.</span><span class="n">walk</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">,</span> <span class="n">topdown</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
    <span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;Found directory: </span><span class="si">{</span><span class="n">dirpath</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">)</span>
    <span class="k">for</span> <span class="n">file_name</span> <span class="ow">in</span> <span class="n">files</span><span class="p">:</span>
        <span class="nb">print</span><span class="p">(</span><span class="n">file_name</span><span class="p">)</span>
</code></pre></div>
<p>传递<code>topdown = False</code>参数将使<code>os.walk()</code>首先打印出它在子目录中找到的文件：</p>
<div class="highlight"><pre><span></span><code>Found<span class="w"> </span>directory:<span class="w"> </span>./folder_1
file1.py
file3.py
file2.py
Found<span class="w"> </span>directory:<span class="w"> </span>./folder_2
file4.py
file5.py
file6.py
Found<span class="w"> </span>directory:<span class="w"> </span>.
test1.txt
test2.txt
</code></pre></div>
<p>如我们所见，程序通过在列出根目录的内容之前列出子目录的内容来启动。 这在我们想要递归删除文件和目录的情况下非常有用(我们将在下面章节部分中学习如何执行此操作)。默认情况下，<code>os.walk</code>不会向下走到符号链接文件所指向的目录中。 我们可以通过使用<code>followlinks = True</code>参数调用此行为来覆盖此行为</p>
<h1 id="创建临时文件和目录">创建临时文件和目录<a class="headerlink" href="#创建临时文件和目录" title="Permanent link">&para;</a></h1>
<p>Python 提供了一个名为 <code>tempfile</code> 方便的模块，用于创建临时文件和目录。</p>
<p><code>tempfile</code> 可用于在程序运行时临时在文件或目录中打开和存储数据。另一方面，<code>tempfile</code> 会在程序完成后对临时文件执行删除处理。</p>
<p>以下是创建临时文件的方法：</p>
<div class="highlight"><pre><span></span><code><span class="kn">from</span> <span class="nn">tempfile</span> <span class="kn">import</span> <span class="n">TemporaryFile</span>

<span class="c1"># Create a temporary file and write some data to it</span>
<span class="n">fp</span> <span class="o">=</span> <span class="n">TemporaryFile</span><span class="p">(</span><span class="s1">&#39;w+t&#39;</span><span class="p">)</span>
<span class="n">fp</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">&#39;Hello universe!&#39;</span><span class="p">)</span>

<span class="c1"># Go back to the beginning and read data from file</span>
<span class="n">fp</span><span class="o">.</span><span class="n">seek</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">fp</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>

<span class="c1"># Close the file, after which it will be removed</span>
<span class="n">fp</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
</code></pre></div>
<p>第一步是从<code>tempfile</code>模块导入<code>TemporaryFile</code>。 接下来，使用<code>TemporaryFile()</code>方法，并通过传递要打开文件的模式创建一个类似于 object 的文件。这将创建并打开一个可用作临时存储区域的文件。</p>
<p>在上面的示例中，模式为&rsquo;w + t&rsquo;，这使得<code>tempfile</code>在写入模式下创建临时文本文件。这里没有必要为临时文件提供文件名，因为在脚本运行完毕后它将被销毁。</p>
<p>写入文件后，我们可以从中读取并在完成处理后将其关闭。文件关闭后，将从文件系统中删除。如果需要命名使用<code>tempfile</code>生成的临时文件，请使用<code>tempfile.NamedTemporaryFile()</code>。</p>
<p>使用 tempfile 创建的临时文件和目录存储在一个特殊的用于存储临时文件的系统目录中。 Python 通过搜索标准目录列表以找到用户可以在其中创建文件的目录。</p>
<p>在 Windows 上，目录按顺序为<code>C:\TEMP, C:\TMP, \TEMP, and \TMP</code> 进行搜索。在所有其他平台上，目录按顺序为 <code>/tmp</code> ，<code>/var/tmp</code> ，以及 <code>/usr/tmp</code>。作为最后的手段，<code>tempfile</code> 将保存当前目录中的临时文件和目录。</p>
<p><code>.TemporaryFile()</code>也是一个上下文管理器，因此它可以与 with 语句一起使用。使用上下文管理器会在读取文件后自动关闭和删除文件：</p>
<div class="highlight"><pre><span></span><code><span class="k">with</span> <span class="n">TemporaryFile</span><span class="p">(</span><span class="s1">&#39;w+t&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">fp</span><span class="p">:</span>
    <span class="n">fp</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">&#39;Hello universe!&#39;</span><span class="p">)</span>
    <span class="n">fp</span><span class="o">.</span><span class="n">seek</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
    <span class="n">fp</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
<span class="c1"># File is now closed and removed</span>
</code></pre></div>
<p>这将创建一个临时文件并从中读取数据。 一旦读取文件的内容，就会关闭临时文件并从文件系统中删除。</p>
<p><code>tempfile</code> 也可用于创建临时目录。 让我们看一下如何使用<code>tempfile.TemporaryDirectory()</code>来做到这一点：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="kn">import</span> <span class="nn">tempfile</span>
<span class="o">&gt;&gt;&gt;</span> <span class="k">with</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">TemporaryDirectory</span><span class="p">()</span> <span class="k">as</span> <span class="n">tmpdir</span><span class="p">:</span>
<span class="o">...</span>     <span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Created temporary directory &#39;</span><span class="p">,</span> <span class="n">tmpdir</span><span class="p">)</span>
<span class="o">...</span>     <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">tmpdir</span><span class="p">)</span>
<span class="o">...</span>
<span class="n">Created</span> <span class="n">temporary</span> <span class="n">directory</span>  <span class="o">/</span><span class="n">tmp</span><span class="o">/</span><span class="n">tmpoxbkrm6c</span>
<span class="kc">True</span>

<span class="o">&gt;&gt;&gt;</span> <span class="c1"># Directory contents have been removed</span>
<span class="o">...</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">tmpdir</span>
<span class="s1">&#39;/tmp/tmpoxbkrm6c&#39;</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">tmpdir</span><span class="p">)</span>
<span class="kc">False</span>
</code></pre></div>
<p>调用<code>tempfile.TemporaryDirectory()</code>会在文件系统中创建一个临时目录，并返回一个表示该目录的对象。在上面的示例中，使用上下文管理器创建目录，目录的名称存储在<code>tmpdir</code>中。第三行打印出临时目录的名称，<code>os.path.exists(tmpdir)</code>确认目录是否实际在文件系统中创建。</p>
<p>在上下文管理器退出上下文后，临时目录将被删除，并且对<code>os.path.exists(tmpdir)</code>的调用将返回 False，这意味着该目录已成功删除。</p>
<h1 id="删除文件和目录">删除文件和目录<a class="headerlink" href="#删除文件和目录" title="Permanent link">&para;</a></h1>
<p>我们可以使用<code>os</code>，<code>shutil</code>和<code>pathlib</code>模块中的方法删除单个文件，目录和整个目录树。以下部分介绍如何删除不再需要的文件和目录。</p>
<h2 id="在-python-中删除文件">在 Python 中删除文件<a class="headerlink" href="#在-python-中删除文件" title="Permanent link">&para;</a></h2>
<p>要删除单个文件，请使用<code>pathlib.Path.unlink()</code>，<code>os.remove()</code> 或者<code>os.unlink()</code>。</p>
<p><code>os.remove()</code>和<code>os.unlink()</code>在语义上是相同的。要使用<code>os.remove()</code>删除文件，请执行以下操作：</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">os</span>

<span class="n">data_file</span> <span class="o">=</span> <span class="s1">&#39;C:</span><span class="se">\\</span><span class="s1">Users</span><span class="se">\\</span><span class="s1">vuyisile</span><span class="se">\\</span><span class="s1">Desktop</span><span class="se">\\</span><span class="s1">Test</span><span class="se">\\</span><span class="s1">data.txt&#39;</span>
<span class="n">os</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">data_file</span><span class="p">)</span>
</code></pre></div>
<p>使用<code>os.unlink()</code>删除文件与使用<code>os.remove()</code>的方式类似：</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">os</span>

<span class="n">data_file</span> <span class="o">=</span> <span class="s1">&#39;C:</span><span class="se">\\</span><span class="s1">Users</span><span class="se">\\</span><span class="s1">vuyisile</span><span class="se">\\</span><span class="s1">Desktop</span><span class="se">\\</span><span class="s1">Test</span><span class="se">\\</span><span class="s1">data.txt&#39;</span>
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">data_file</span><span class="p">)</span>
</code></pre></div>
<p>在文件上调用<code>.unlink()</code>或<code>.remove()</code>会从文件系统中删除该文件。如果传递给它们的路径指向目录而不是文件，这两个函数将抛出<code>OSError</code>。为避免这种情况，我们可以：检查确认我们实际想要删除的只是文件，并当且仅当它是文件才执行删除；或者使用异常处理来处理<code>OSError</code>：</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">os</span>

<span class="n">data_file</span> <span class="o">=</span> <span class="s1">&#39;home/data.txt&#39;</span>

<span class="c1"># If the file exists, delete it</span>
<span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isfile</span><span class="p">(</span><span class="n">data_file</span><span class="p">):</span>
    <span class="n">os</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">data_file</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
    <span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;Error: </span><span class="si">{</span><span class="n">data_file</span><span class="si">}</span><span class="s1"> not a valid filename&#39;</span><span class="p">)</span>
</code></pre></div>
<p><code>os.path.isfile()</code> 用于检查<code>data_file</code>是否实际上是一个文件。如果是，则通过调用<code>os.remove()</code>删除它。如果<code>data_file</code>指向文件夹(目录)，则会向控制台输出错误消息。</p>
<p>以下示例说明如何在删除文件时使用异常处理来处理错误：</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">os</span>

<span class="n">data_file</span> <span class="o">=</span> <span class="s1">&#39;home/data.txt&#39;</span>

<span class="c1"># Use exception handling</span>
<span class="k">try</span><span class="p">:</span>
    <span class="n">os</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">data_file</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">OSError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
    <span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;Error: </span><span class="si">{</span><span class="n">data_file</span><span class="si">}</span><span class="s1"> : </span><span class="si">{</span><span class="n">e</span><span class="o">.</span><span class="n">strerror</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">)</span>
</code></pre></div>
<p>上面的代码尝试在检查其类型之前先删除该文件。如果<code>data_file</code>实际上不是文件，则抛出的<code>OSError</code>将<code>在except</code>子句中处理，并向控制台输出错误消息。打印出的错误消息使用  <a href="https://realpython.com/python-f-strings/">Python f-strings</a>  格式化。</p>
<p>最后，我们还可以使用<code>pathlib.Path.unlink()</code>删除文件：</p>
<div class="highlight"><pre><span></span><code>from pathlib import Path

data_file = Path(&#39;home/data.txt&#39;)

try:
    data_file.unlink()
except IsADirectoryError as e:
    print(f&#39;Error: {data_file} : {e.strerror}&#39;)
</code></pre></div>
<p>上面的代码将创建一个名为<code>data_file</code>的 Path 对象，该对象指向文件。在<code>data_file上</code>调用<code>.remove()</code>将删除<code>home/data.txt</code>。 如果<code>data_file</code>指向目录，则引发<code>IsADirectoryError</code>。值得注意的是，上面的 Python 程序与运行它的用户具有相同的权限。如果用户没有删除文件的权限，则会引发<code>PermissionError</code>。</p>
<h2 id="删除目录">删除目录<a class="headerlink" href="#删除目录" title="Permanent link">&para;</a></h2>
<p>Python 的标准库提供以下删除目录的功能：</p>
<ul>
<li><code>os.rmdir()</code></li>
<li><code>pathlib.Path.rmdir()</code></li>
<li><code>shutil.rmtree()</code></li>
</ul>
<p>要删除单个目录或文件夹，请使用<code>os.rmdir()</code>或<code>pathlib.rmdir()</code>。这两个函数仅在我们尝试删除的目录为空时才有效。如果目录不为空，则引发<code>OSError</code>。以下是删除文件夹的方法：</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">os</span>

<span class="n">trash_dir</span> <span class="o">=</span> <span class="s1">&#39;my_documents/bad_dir&#39;</span>

<span class="k">try</span><span class="p">:</span>
    <span class="n">os</span><span class="o">.</span><span class="n">rmdir</span><span class="p">(</span><span class="n">trash_dir</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">OSError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
    <span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;Error: </span><span class="si">{</span><span class="n">trash_dir</span><span class="si">}</span><span class="s1"> : </span><span class="si">{</span><span class="n">e</span><span class="o">.</span><span class="n">strerror</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">)</span>
</code></pre></div>
<p>这里，通过将其路径作为参数传递给<code>os.rmdir()</code>来删除<code>trash_dir</code>目录。如果目录不为空，则会在屏幕上显示错误消息：</p>
<div class="highlight"><pre><span></span><code><span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
  <span class="n">File</span> <span class="s1">&#39;&lt;stdin&gt;&#39;</span><span class="p">,</span> <span class="n">line</span> <span class="mi">1</span><span class="p">,</span> <span class="ow">in</span> <span class="o">&lt;</span><span class="n">module</span><span class="o">&gt;</span>
<span class="ne">OSError</span><span class="p">:</span> <span class="p">[</span><span class="n">Errno</span> <span class="mi">39</span><span class="p">]</span> <span class="n">Directory</span> <span class="ow">not</span> <span class="n">empty</span><span class="p">:</span> <span class="s1">&#39;my_documents/bad_dir&#39;</span>
</code></pre></div>
<p>或者，我们可以使用<code>pathlib</code>删除目录：</p>
<div class="highlight"><pre><span></span><code><span class="kn">from</span> <span class="nn">pathlib</span> <span class="kn">import</span> <span class="n">Path</span>

<span class="n">trash_dir</span> <span class="o">=</span> <span class="n">Path</span><span class="p">(</span><span class="s1">&#39;my_documents/bad_dir&#39;</span><span class="p">)</span>

<span class="k">try</span><span class="p">:</span>
    <span class="n">trash_dir</span><span class="o">.</span><span class="n">rmdir</span><span class="p">()</span>
<span class="k">except</span> <span class="ne">OSError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
    <span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;Error: </span><span class="si">{</span><span class="n">trash_dir</span><span class="si">}</span><span class="s1"> : </span><span class="si">{</span><span class="n">e</span><span class="o">.</span><span class="n">strerror</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">)</span>
</code></pre></div>
<p>在这里，我们创建一个指向要删除的目录的 Path 对象。如果目录为空，则在 Path 对象上调用<code>.rmdir()</code>将它删除。</p>
<h2 id="删除整个目录树">删除整个目录树<a class="headerlink" href="#删除整个目录树" title="Permanent link">&para;</a></h2>
<p>要删除非空目录和整个目录树，Python 提供了<code>shutil.rmtree()</code>：</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">shutil</span>

<span class="n">trash_dir</span> <span class="o">=</span> <span class="s1">&#39;my_documents/bad_dir&#39;</span>

<span class="k">try</span><span class="p">:</span>
    <span class="n">shutil</span><span class="o">.</span><span class="n">rmtree</span><span class="p">(</span><span class="n">trash_dir</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">OSError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
    <span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;Error: </span><span class="si">{</span><span class="n">trash_dir</span><span class="si">}</span><span class="s1"> : </span><span class="si">{</span><span class="n">e</span><span class="o">.</span><span class="n">strerror</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">)</span>
</code></pre></div>
<p>当对<code>shutil.rmtree()</code>进行调用时，<code>trash_dir</code>中的所有内容都将被删除。在某些情况下，我们可能希望以递归方式删除空文件夹。对此，我们可以结合上面提到的<code>os.walk()</code>方法来完成此操作：</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">os</span>

<span class="k">for</span> <span class="n">dirpath</span><span class="p">,</span> <span class="n">dirnames</span><span class="p">,</span> <span class="n">files</span> <span class="ow">in</span> <span class="n">os</span><span class="o">.</span><span class="n">walk</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">,</span> <span class="n">topdown</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
    <span class="k">try</span><span class="p">:</span>
        <span class="n">os</span><span class="o">.</span><span class="n">rmdir</span><span class="p">(</span><span class="n">dirpath</span><span class="p">)</span>
    <span class="k">except</span> <span class="ne">OSError</span> <span class="k">as</span> <span class="n">ex</span><span class="p">:</span>
        <span class="k">pass</span>
</code></pre></div>
<p>这将遍历目录树并尝试删除它找到的每个目录。如果目录不为空，则引发<code>OSError</code>并跳过该目录。</p>
<p>下表列出了本节中涉及的功能：</p>
<p><a class="glightbox" href="https://shub.weiyan.tech/yuque/elog-cookbook-img/FhnGoA-AuSfdhwSq0vpk3LfI90mc.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="" src="https://shub.weiyan.tech/yuque/elog-cookbook-img/FhnGoA-AuSfdhwSq0vpk3LfI90mc.png" /></a></p>
<h1 id="文件和目录复制移动及重命名">文件和目录复制，移动及重命名<a class="headerlink" href="#文件和目录复制移动及重命名" title="Permanent link">&para;</a></h1>
<p>Python 附带的<code>shutil</code>模块，是 shell 实用程序的缩写。它为文件提供了许多高级操作，以支持文件和目录的复制，存档和删除。在本节中，我们将学习如何移动和复制文件和目录。</p>
<h2 id="python-中的文件复制">Python 中的文件复制<a class="headerlink" href="#python-中的文件复制" title="Permanent link">&para;</a></h2>
<p><code>shutil</code> 提供了一些复制文件的功能。其中最常用的函数是<code>shutil.copy()</code>和<code>shutil.copy2()</code>。要使用<code>shutil.copy()</code>将文件从一个位置复制到另一个位置，请执行以下操作：</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">shutil</span>

<span class="n">src</span> <span class="o">=</span> <span class="s1">&#39;path/to/file.txt&#39;</span>
<span class="n">dst</span> <span class="o">=</span> <span class="s1">&#39;path/to/dest_dir&#39;</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">copy</span><span class="p">(</span><span class="n">src</span><span class="p">,</span> <span class="n">dst</span><span class="p">)</span>
</code></pre></div>
<p><code>shutil.copy()</code>与 UNIX 系统中的 <code>cp</code> 命令相当。<code>shutil.copy(src, dst)</code>会将文件 src 复制到 dst 指定的位置。如果 dst 是文件，则该文件的内容将替换为 src 的内容。如果 dst 是目录，则 src 将被复制到该目录中。<code>shutil.copy()</code>仅复制文件的内容和文件的权限。其他元数据（如文件的创建和修改时间）不会保留。</p>
<p>要在复制时保留所有文件元数据，请使用<code>shutil.copy2()</code>：</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">shutil</span>

<span class="n">src</span> <span class="o">=</span> <span class="s1">&#39;path/to/file.txt&#39;</span>
<span class="n">dst</span> <span class="o">=</span> <span class="s1">&#39;path/to/dest_dir&#39;</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">copy2</span><span class="p">(</span><span class="n">src</span><span class="p">,</span> <span class="n">dst</span><span class="p">)</span>
</code></pre></div>
<p>使用<code>.copy2()</code>可保留有关文件的详细信息，例如上次访问时间，权限位，上次修改时间和标志。</p>
<h2 id="python-中的目录复制">Python 中的目录复制<a class="headerlink" href="#python-中的目录复制" title="Permanent link">&para;</a></h2>
<p>虽然<code>shutil.copy()</code>只复制单个文件，但<code>shutil.copytree()</code>可以将复制整个目录及其中包含的所有内容。<code>shutil.copytree(src, dest)</code>有两个参数：源目录；将文件和文件夹复制到的目标目录。</p>
<p>以下是如何将一个文件夹的内容复制到其他位置的示例：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="kn">import</span> <span class="nn">shutil</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">shutil</span><span class="o">.</span><span class="n">copytree</span><span class="p">(</span><span class="s1">&#39;data_1&#39;</span><span class="p">,</span> <span class="s1">&#39;data1_backup&#39;</span><span class="p">)</span>
<span class="s1">&#39;data1_backup&#39;</span>
</code></pre></div>
<p>在此示例中，<code>.copytree()</code> 将 <code>data_1</code> 的内容复制到新位置 <code>data1_backup</code> 并返回目标目录。如果目标目录不存在，它以及其缺少的父目录将被一起创建。<code>shutil.copytree()</code>是备份文件的好方法。</p>
<h2 id="移动文件和目录">移动文件和目录<a class="headerlink" href="#移动文件和目录" title="Permanent link">&para;</a></h2>
<p>要将文件或目录移动到其他位置，请使用<code>shutil.move(src, dst)</code>，其中 src 是要移动的文件或目录，dst 是目标文件或者目录：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="kn">import</span> <span class="nn">shutil</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">shutil</span><span class="o">.</span><span class="n">move</span><span class="p">(</span><span class="s1">&#39;dir_1/&#39;</span><span class="p">,</span> <span class="s1">&#39;backup/&#39;</span><span class="p">)</span>
<span class="s1">&#39;backup&#39;</span>
</code></pre></div>
<p>如果<code>backup/</code>存在，<code>shutil.move('dir_1/', 'backup/')</code>将会把<code>dir_1/</code>移动到<code>backup/</code>目录；如果<code>backup/</code>目录不存在，则<code>dir_1/</code>将重命名为<code>backup</code>。</p>
<h2 id="重命名文件和目录">重命名文件和目录<a class="headerlink" href="#重命名文件和目录" title="Permanent link">&para;</a></h2>
<p>Python 内置的<code>os.rename(src, dst)</code>可用于文件和目录的重命名：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">os</span><span class="o">.</span><span class="n">rename</span><span class="p">(</span><span class="s1">&#39;first.zip&#39;</span><span class="p">,</span> <span class="s1">&#39;first_01.zip&#39;</span><span class="p">)</span>
</code></pre></div>
<p>上面的代码行将<code>first.zip</code>重命名为<code>first_01.zip</code>。如果目标路径指向目录，则会引发<code>OSError</code>。</p>
<p>重命名文件或目录的另一种方法是使用<code>pathlib</code>模块中的<code>rename()</code>：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="kn">from</span> <span class="nn">pathlib</span> <span class="kn">import</span> <span class="n">Path</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">data_file</span> <span class="o">=</span> <span class="n">Path</span><span class="p">(</span><span class="s1">&#39;data_01.txt&#39;</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">data_file</span><span class="o">.</span><span class="n">rename</span><span class="p">(</span><span class="s1">&#39;data.txt&#39;</span><span class="p">)</span>
</code></pre></div>
<p>要使用<code>pathlib</code>重命名文件，首先要创建一个<code>pathlib.Path()</code>对象，该对象包含要替换的文件的路径。下一步是在路径对象上调用<code>rename()</code>并为我们要重命名的文件或目录传递新文件名。</p>
<h1 id="归档">归档<a class="headerlink" href="#归档" title="Permanent link">&para;</a></h1>
<p>归档是将多个文件打包成一个文件的便捷方式。两种最常见的存档类型是 ZIP 和 TAR。我们编写的 Python 程序可以从归档中创建，读取和提取数据。我们将在本节中学习如何从两种存档格式文件中读取和写入数据。</p>
<h2 id="读取-zip-文件">读取 ZIP 文件<a class="headerlink" href="#读取-zip-文件" title="Permanent link">&para;</a></h2>
<p><code>zipfile</code>模块是一个低级模块，是 Python 标准库的一部分。<code>zipfile</code>具有可以轻松打开和提取 ZIP 文件的功能。要读取 ZIP 文件的内容，我们首先要做的是创建一个 ZipFile 对象。ZipFile 对象类似于使用 <code>open()</code>创建的文件对象。ZipFile 同时也是一个上下文管理器，因此支持 <code>with</code> 语句：</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">zipfile</span>

<span class="k">with</span> <span class="n">zipfile</span><span class="o">.</span><span class="n">ZipFile</span><span class="p">(</span><span class="s1">&#39;data.zip&#39;</span><span class="p">,</span> <span class="s1">&#39;r&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">zipobj</span><span class="p">:</span>
</code></pre></div>
<p>在这里，您创建一个 ZipFile 对象，传入 ZIP 的文件名称并在读取模式下打开。打开 ZIP 文件后，可以通过<code>zipfile</code>模块提供的功能访问有关存档的信息。上面示例中的 data.zip 存档是从名为 data 的目录创建的，该目录包含总共 5 个文件和 1 个子目录：</p>
<div class="highlight"><pre><span></span><code>.
<span class="p">|</span>
├──<span class="w"> </span>sub_dir/
<span class="p">|</span><span class="w">   </span>├──<span class="w"> </span>bar.py
<span class="p">|</span><span class="w">   </span>└──<span class="w"> </span>foo.py
<span class="p">|</span>
├──<span class="w"> </span>file1.py
├──<span class="w"> </span>file2.py
└──<span class="w"> </span>file3.py
</code></pre></div>
<p>要获取存档中的文件列表，请在 ZipFile 对象上调用<code>namelist()</code>：</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">zipfile</span>

<span class="k">with</span> <span class="n">zipfile</span><span class="o">.</span><span class="n">ZipFile</span><span class="p">(</span><span class="s1">&#39;data.zip&#39;</span><span class="p">,</span> <span class="s1">&#39;r&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">zipobj</span><span class="p">:</span>
    <span class="n">zipobj</span><span class="o">.</span><span class="n">namelist</span><span class="p">()</span>
</code></pre></div>
<p>以上代码将会产生一个列表结果：</p>
<div class="highlight"><pre><span></span><code><span class="p">[</span><span class="s1">&#39;file1.py&#39;</span><span class="p">,</span> <span class="s1">&#39;file2.py&#39;</span><span class="p">,</span> <span class="s1">&#39;file3.py&#39;</span><span class="p">,</span> <span class="s1">&#39;sub_dir/&#39;</span><span class="p">,</span> <span class="s1">&#39;sub_dir/bar.py&#39;</span><span class="p">,</span> <span class="s1">&#39;sub_dir/foo.py&#39;</span><span class="p">]</span>
</code></pre></div>
<p><code>.namelist()</code>返回归档中文件和目录的名称列表。要检索有关存档中文件的信息，请使用<code>.getinfo()</code>：</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">zipfile</span>

<span class="k">with</span> <span class="n">zipfile</span><span class="o">.</span><span class="n">ZipFile</span><span class="p">(</span><span class="s1">&#39;data.zip&#39;</span><span class="p">,</span> <span class="s1">&#39;r&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">zipobj</span><span class="p">:</span>
    <span class="n">bar_info</span> <span class="o">=</span> <span class="n">zipobj</span><span class="o">.</span><span class="n">getinfo</span><span class="p">(</span><span class="s1">&#39;sub_dir/bar.py&#39;</span><span class="p">)</span>
    <span class="n">bar_info</span><span class="o">.</span><span class="n">file_size</span>
</code></pre></div>
<p>代码结果如下：</p>
<div class="highlight"><pre><span></span><code><span class="m">15277</span>
</code></pre></div>
<p><code>.getinfo()</code>返回一个 ZipInfo 对象，该对象存储有关存档的单个成员的信息。要获取有关归档中文件的信息，请将其路径作为参数传递给<code>.getinfo()</code>。使用<code>getinfo()</code>，我们可以检索有关存档成员的信息，例如上次修改文件的日期，压缩大小及其完整文件名。调用<code>.file_size</code>将以字节为单位检索文件的原始大小。</p>
<p>以下示例说明如何在 Python REPL 中检索有关已归档文件的更多详细信息。假设已导入<code>zipfile</code>模块，bar_info 与我们在前面的示例中创建的对象相同：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">bar_info</span><span class="o">.</span><span class="n">date_time</span>
<span class="p">(</span><span class="mi">2018</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="mi">7</span><span class="p">,</span> <span class="mi">23</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">bar_info</span><span class="o">.</span><span class="n">compress_size</span>
<span class="mi">2856</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">bar_info</span><span class="o">.</span><span class="n">filename</span>
<span class="s1">&#39;sub_dir/bar.py&#39;</span>
</code></pre></div>
<ul>
<li>bar_info 包含有关 bar.py 的详细信息，例如压缩时的大小及其完整路径。</li>
<li>第一行显示了如何检索文件的上次修改日期。下一行显示了如何在压缩后获取文件的大小。最后一行显示了存档中 bar.py 的完整路径。</li>
</ul>
<p><code>ZipFile</code> 支持上下文管理器协议，这就是我们可以将它与 <code>with</code> 语句一起使用的原因。完成后，执行此操作会自动关闭 ZipFile 对象。如果我们尝试从已关闭的 ZipFile 对象中打开或提取文件将导致错误。</p>
<h2 id="提取-zip-归档">提取 ZIP 归档<a class="headerlink" href="#提取-zip-归档" title="Permanent link">&para;</a></h2>
<p><code>zipfile</code>模块允许我们通过<code>.extract()</code>和<code>.extractall()</code>从 ZIP 压缩文件中提取一个或多个文件。</p>
<p>默认情况下，这些方法将文件解压缩到当前目录。 它们都采用可选的路径参数，允许我们指定要将文件提取到的其他目录。 如果该目录不存在，则会自动创建该目录。 要从存档中提取文件，请执行以下操作：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="kn">import</span> <span class="nn">zipfile</span>
<span class="o">&gt;&gt;&gt;</span> <span class="kn">import</span> <span class="nn">os</span>

<span class="o">&gt;&gt;&gt;</span> <span class="n">os</span><span class="o">.</span><span class="n">listdir</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">)</span>
<span class="p">[</span><span class="s1">&#39;data.zip&#39;</span><span class="p">]</span>

<span class="o">&gt;&gt;&gt;</span> <span class="n">data_zip</span> <span class="o">=</span> <span class="n">zipfile</span><span class="o">.</span><span class="n">ZipFile</span><span class="p">(</span><span class="s1">&#39;data.zip&#39;</span><span class="p">,</span> <span class="s1">&#39;r&#39;</span><span class="p">)</span>

<span class="o">&gt;&gt;&gt;</span> <span class="c1"># Extract a single file to current directory</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">data_zip</span><span class="o">.</span><span class="n">extract</span><span class="p">(</span><span class="s1">&#39;file1.py&#39;</span><span class="p">)</span>
<span class="s1">&#39;/home/terra/test/dir1/zip_extract/file1.py&#39;</span>

<span class="o">&gt;&gt;&gt;</span> <span class="n">os</span><span class="o">.</span><span class="n">listdir</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">)</span>
<span class="p">[</span><span class="s1">&#39;file1.py&#39;</span><span class="p">,</span> <span class="s1">&#39;data.zip&#39;</span><span class="p">]</span>

<span class="o">&gt;&gt;&gt;</span> <span class="c1"># Extract all files into a different directory</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">data_zip</span><span class="o">.</span><span class="n">extractall</span><span class="p">(</span><span class="n">path</span><span class="o">=</span><span class="s1">&#39;extract_dir/&#39;</span><span class="p">)</span>

<span class="o">&gt;&gt;&gt;</span> <span class="n">os</span><span class="o">.</span><span class="n">listdir</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">)</span>
<span class="p">[</span><span class="s1">&#39;file1.py&#39;</span><span class="p">,</span> <span class="s1">&#39;extract_dir&#39;</span><span class="p">,</span> <span class="s1">&#39;data.zip&#39;</span><span class="p">]</span>

<span class="o">&gt;&gt;&gt;</span> <span class="n">os</span><span class="o">.</span><span class="n">listdir</span><span class="p">(</span><span class="s1">&#39;extract_dir&#39;</span><span class="p">)</span>
<span class="p">[</span><span class="s1">&#39;file1.py&#39;</span><span class="p">,</span> <span class="s1">&#39;file3.py&#39;</span><span class="p">,</span> <span class="s1">&#39;file2.py&#39;</span><span class="p">,</span> <span class="s1">&#39;sub_dir&#39;</span><span class="p">]</span>

<span class="o">&gt;&gt;&gt;</span> <span class="n">data_zip</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
</code></pre></div>
<p>第三行代码是对<code>os.listdir()</code>的调用，它显示当前目录只有一个文件<code>data.zip</code>。</p>
<p>接下来，在读取模式下打开<code>data.zip</code>并调用<code>.extract()</code>从中提取<code>file1.py</code>。 <code>.extract()</code>返回解压缩文件的完整文件路径。 由于没有指定路径，<code>.extract()</code>会将 <code>file1.py</code> 提取到当前目录。</p>
<p>下一行代码打印一个目录列表，显示当前目录除原始存档之外的解压缩文件。之后的行显示了如何将整个存档解压缩到<code>zip_extract</code>目录中。 <code>.extractall()</code> 创建 <code>extract_dir</code> 并将 <code>data.zip</code> 的内容提取到其中。最后一行关闭 ZIP 存档。</p>
<h2 id="从受密码保护的归档中提取数据">从受密码保护的归档中提取数据<a class="headerlink" href="#从受密码保护的归档中提取数据" title="Permanent link">&para;</a></h2>
<p><code>zipfile</code>支持提取受密码保护的 ZIP。要提取受密码保护的 ZIP 文件，请将密码作为参数传递给<code>.extract()</code>或<code>.extractall()</code>方法：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="kn">import</span> <span class="nn">zipfile</span>

<span class="o">&gt;&gt;&gt;</span> <span class="k">with</span> <span class="n">zipfile</span><span class="o">.</span><span class="n">ZipFile</span><span class="p">(</span><span class="s1">&#39;secret.zip&#39;</span><span class="p">,</span> <span class="s1">&#39;r&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">pwd_zip</span><span class="p">:</span>
<span class="o">...</span>     <span class="c1"># Extract from a password protected archive</span>
<span class="o">...</span>     <span class="n">pwd_zip</span><span class="o">.</span><span class="n">extractall</span><span class="p">(</span><span class="n">path</span><span class="o">=</span><span class="s1">&#39;extract_dir&#39;</span><span class="p">,</span> <span class="n">pwd</span><span class="o">=</span><span class="s1">&#39;Quish3@o&#39;</span><span class="p">)</span>
</code></pre></div>
<p>这将以读取模式打开 secret.zip 存档。接下来，把密码提供给<code>.extractall()</code>，存档内容被提取到<code>extract_dir</code>。由于 with 语句，在完成提取后，存档会自动关闭。</p>
<h2 id="创建新的-zip-存档">创建新的 ZIP 存档<a class="headerlink" href="#创建新的-zip-存档" title="Permanent link">&para;</a></h2>
<p>要创建新的 ZIP 存档，请以写入模式（w）打开 <code>ZipFile</code> 对象并添加要存档的文件：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="kn">import</span> <span class="nn">zipfile</span>

<span class="o">&gt;&gt;&gt;</span> <span class="n">file_list</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;file1.py&#39;</span><span class="p">,</span> <span class="s1">&#39;sub_dir/&#39;</span><span class="p">,</span> <span class="s1">&#39;sub_dir/bar.py&#39;</span><span class="p">,</span> <span class="s1">&#39;sub_dir/foo.py&#39;</span><span class="p">]</span>
<span class="o">&gt;&gt;&gt;</span> <span class="k">with</span> <span class="n">zipfile</span><span class="o">.</span><span class="n">ZipFile</span><span class="p">(</span><span class="s1">&#39;new.zip&#39;</span><span class="p">,</span> <span class="s1">&#39;w&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">new_zip</span><span class="p">:</span>
<span class="o">...</span>     <span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">file_list</span><span class="p">:</span>
<span class="o">...</span>         <span class="n">new_zip</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">name</span><span class="p">)</span>
</code></pre></div>
<p>在该示例中，我们以写入模式打开<code>new_zip</code>，然后把 <code>file_list</code> 中的每个文件都添加到归档中。完成<code>with</code>语句套件后，将关闭<code>new_zip</code>。以写入模式打开 ZIP 文件会删除存档的内容并创建新存档。</p>
<p>要将文件添加到现有存档，请以追加模式打开<code>ZipFile</code>对象，然后添加文件：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="c1"># Open a ZipFile object in append mode</span>
<span class="o">&gt;&gt;&gt;</span> <span class="k">with</span> <span class="n">zipfile</span><span class="o">.</span><span class="n">ZipFile</span><span class="p">(</span><span class="s1">&#39;new.zip&#39;</span><span class="p">,</span> <span class="s1">&#39;a&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">new_zip</span><span class="p">:</span>
<span class="o">...</span>     <span class="n">new_zip</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">&#39;data.txt&#39;</span><span class="p">)</span>
<span class="o">...</span>     <span class="n">new_zip</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">&#39;latin.txt&#39;</span><span class="p">)</span>
</code></pre></div>
<p>在这里，我们打开在上一个示例中以追加模式创建的 new.zip 存档。在追加模式下打开<code>ZipFile</code>对象允许您将新文件添加到 ZIP 文件而不删除其当前内容。将文件添加到 ZIP 文件后，<code>with</code> 语句将脱离上下文并关闭 ZIP 文件。</p>
<h2 id="打开-tar-归档">打开 TAR 归档<a class="headerlink" href="#打开-tar-归档" title="Permanent link">&para;</a></h2>
<p>TAR 文件是 ZIP 等未压缩文件的存档。它们可以使 用 gzip，bzip2 和 lzma 压缩方法进行压缩。<code>TarFile</code> 类允许读取和写入 TAR 存档。</p>
<p>这样做是为了从存档中读取：</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">tarfile</span>

<span class="k">with</span> <span class="n">tarfile</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">&#39;example.tar&#39;</span><span class="p">,</span> <span class="s1">&#39;r&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">tar_file</span><span class="p">:</span>
    <span class="nb">print</span><span class="p">(</span><span class="n">tar_file</span><span class="o">.</span><span class="n">getnames</span><span class="p">())</span>
</code></pre></div>
<p><code>tarfile</code>对象的打开方式跟大多数类似文件对象的打开方式一样。它们有一个<code>open()</code>函数，并采用一种模式来确定文件的打开方式。</p>
<p>使用 &ldquo;r&rdquo;，&rdquo;w&rdquo; 或 &ldquo;a&rdquo; 模式分别打开未压缩的 TAR 文件以进行读取，写入和追加。要打开压缩的 TAR 文件，需要将模式参数传递给<code>tarfile.open()</code>，其格式为<code>filemode [:compression]</code>。下表列出了可以打开 TAR 文件的可能模式：</p>
<p><a class="glightbox" href="https://shub.weiyan.tech/yuque/elog-cookbook-img/FgziSqW07iV6C4R7KR0e66AkoSuO.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="" src="https://shub.weiyan.tech/yuque/elog-cookbook-img/FgziSqW07iV6C4R7KR0e66AkoSuO.png" /></a></p>
<p><code>.open()</code> 默认以 &lsquo;r&rsquo; 模式打开文件。要读取未压缩的 TAR 文件并检索其中的文件名，可以使用<code>.getnames()</code>：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="kn">import</span> <span class="nn">tarfile</span>

<span class="o">&gt;&gt;&gt;</span> <span class="n">tar</span> <span class="o">=</span> <span class="n">tarfile</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">&#39;example.tar&#39;</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="s1">&#39;r&#39;</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">tar</span><span class="o">.</span><span class="n">getnames</span><span class="p">()</span>
<span class="p">[</span><span class="s1">&#39;CONTRIBUTING.rst&#39;</span><span class="p">,</span> <span class="s1">&#39;README.md&#39;</span><span class="p">,</span> <span class="s1">&#39;app.py&#39;</span><span class="p">]</span>
</code></pre></div>
<p>这将返回一个包含存档内容名称的列表。</p>
<p>可以使用特殊属性访问存档中每个条目的元数据：</p>
<div class="highlight"><pre><span></span><code>&gt;&gt;&gt; for entry in tar.getmembers():
...     print(entry.name)
...     print(&#39; Modified:&#39;, time.ctime(entry.mtime))
...     print(&#39; Size    :&#39;, entry.size, &#39;bytes&#39;)
...     print()
CONTRIBUTING.rst
 Modified: Sat Nov  1 09:09:51 2018
 Size    : 402 bytes

README.md
 Modified: Sat Nov  3 07:29:40 2018
 Size    : 5426 bytes

app.py
 Modified: Sat Nov  3 07:29:13 2018
 Size    : 6218 bytes
</code></pre></div>
<p>在此示例中，循环遍历<code>.getmembers()</code>返回的文件列表，并打印出每个文件的属性。<code>.getmembers()</code>返回的对象具有可以通过编程方式访问的属性，例如归档中每个文件的名称，大小和上次修改时间。在读取或写入存档后，我们必须关闭它以释放系统资源。</p>
<h2 id="从-tar-存档中提取文件">从 TAR 存档中提取文件<a class="headerlink" href="#从-tar-存档中提取文件" title="Permanent link">&para;</a></h2>
<p>在本节中，我们学习一下如何使用下面的方法从 TAR 存档中提取文件：</p>
<ul>
<li><code>.extract()</code></li>
<li><code>.extractfile()</code></li>
<li><code>.extractall()</code></li>
</ul>
<p>要从 TAR 存档中提取单个文件，可以使用<code>extract()</code>，并传入文件名：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">tar</span><span class="o">.</span><span class="n">extract</span><span class="p">(</span><span class="s1">&#39;README.md&#39;</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">os</span><span class="o">.</span><span class="n">listdir</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">)</span>
<span class="p">[</span><span class="s1">&#39;README.md&#39;</span><span class="p">,</span> <span class="s1">&#39;example.tar&#39;</span><span class="p">]</span>
</code></pre></div>
<p><code>README.md</code>文件从存档中提取到文件系统。然后调用<code>os.listdir()</code>确认<code>README.md</code>文件已成功提取到当前目录中。要从存档中解压缩或提取所有内容，可以使用<code>.extractall()</code>：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">tar</span><span class="o">.</span><span class="n">extractall</span><span class="p">(</span><span class="n">path</span><span class="o">=</span><span class="s2">&quot;extracted/&quot;</span><span class="p">)</span>
</code></pre></div>
<p><code>.extractall()</code>有一个可选的 <code>path</code> 参数来指定解压缩文件的去向。这里，存档被解压缩到解压缩的目录中。以下命令显示已成功提取存档：</p>
<div class="highlight"><pre><span></span><code><span class="err">$</span> <span class="n">ls</span>
<span class="n">example</span><span class="o">.</span><span class="n">tar</span>  <span class="n">extracted</span>  <span class="n">README</span><span class="o">.</span><span class="n">md</span>

<span class="err">$</span> <span class="n">tree</span>
<span class="o">.</span>
<span class="err">├──</span> <span class="n">example</span><span class="o">.</span><span class="n">tar</span>
<span class="err">├──</span> <span class="n">extracted</span>
<span class="o">|</span>   <span class="err">├──</span> <span class="n">app</span><span class="o">.</span><span class="n">py</span>
<span class="o">|</span>   <span class="err">├──</span> <span class="n">CONTRIBUTING</span><span class="o">.</span><span class="n">rst</span>
<span class="o">|</span>   <span class="err">└──</span> <span class="n">README</span><span class="o">.</span><span class="n">md</span>
<span class="err">└──</span> <span class="n">README</span><span class="o">.</span><span class="n">md</span>

<span class="mi">1</span> <span class="n">directory</span><span class="p">,</span> <span class="mi">5</span> <span class="n">files</span>

<span class="err">$</span> <span class="n">ls</span> <span class="n">extracted</span><span class="o">/</span>
<span class="n">app</span><span class="o">.</span><span class="n">py</span>  <span class="n">CONTRIBUTING</span><span class="o">.</span><span class="n">rst</span>  <span class="n">README</span><span class="o">.</span><span class="n">md</span>
</code></pre></div>
<p>要提取文件对象以进行读取或写入，可以使用<code>.extractfile()</code>，它将文件名或<code>TarInfo</code>对象作为参数提取。<code>.extractfile()</code>返回一个可以读取和使用的类文件对象：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">f</span> <span class="o">=</span> <span class="n">tar</span><span class="o">.</span><span class="n">extractfile</span><span class="p">(</span><span class="s1">&#39;app.py&#39;</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">f</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">tar</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
</code></pre></div>
<p>打开的存档文件应在读取或写入后始终关闭。要关闭存档，需要在存档文件句柄上调用<code>.close()</code>，或在创建<code>1tarfile</code>对象时使用<code>with</code>语句，以便在完成后自动关闭存档。这将释放系统资源，并把我们对存档所做的任何更改写入文件系统。</p>
<h2 id="创建新的-tar-存档">创建新的 TAR 存档<a class="headerlink" href="#创建新的-tar-存档" title="Permanent link">&para;</a></h2>
<p>创建新的 TAR 存档，可以参考下面的做法：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="kn">import</span> <span class="nn">tarfile</span>

<span class="o">&gt;&gt;&gt;</span> <span class="n">file_list</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;app.py&#39;</span><span class="p">,</span> <span class="s1">&#39;config.py&#39;</span><span class="p">,</span> <span class="s1">&#39;CONTRIBUTORS.md&#39;</span><span class="p">,</span> <span class="s1">&#39;tests.py&#39;</span><span class="p">]</span>
<span class="o">&gt;&gt;&gt;</span> <span class="k">with</span> <span class="n">tarfile</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">&#39;packages.tar&#39;</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="s1">&#39;w&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">tar</span><span class="p">:</span>
<span class="o">...</span>     <span class="k">for</span> <span class="n">file</span> <span class="ow">in</span> <span class="n">file_list</span><span class="p">:</span>
<span class="o">...</span>         <span class="n">tar</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">file</span><span class="p">)</span>

<span class="o">&gt;&gt;&gt;</span> <span class="c1"># Read the contents of the newly created archive</span>
<span class="o">&gt;&gt;&gt;</span> <span class="k">with</span> <span class="n">tarfile</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">&#39;package.tar&#39;</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="s1">&#39;r&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">t</span><span class="p">:</span>
<span class="o">...</span>     <span class="k">for</span> <span class="n">member</span> <span class="ow">in</span> <span class="n">t</span><span class="o">.</span><span class="n">getmembers</span><span class="p">():</span>
<span class="o">...</span>         <span class="nb">print</span><span class="p">(</span><span class="n">member</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
<span class="n">app</span><span class="o">.</span><span class="n">py</span>
<span class="n">config</span><span class="o">.</span><span class="n">py</span>
<span class="n">CONTRIBUTORS</span><span class="o">.</span><span class="n">md</span>
<span class="n">tests</span><span class="o">.</span><span class="n">py</span>
</code></pre></div>
<p>首先，我们要创建要添加到存档的文件列表，这样就不必手动添加每个文件。</p>
<p>下一行代码使用了 <code>with</code> 上下文管理器在写入模式下打开名为 packages.tar 的新存档。同时以写入模式（&rsquo;w&rsquo;）打开存档以便我们可以将新文件写入存档。这样，我们将删除存档中的所有现有文件，并创建新存档。</p>
<p>创建并填充存档后，<code>with</code> 上下文管理器会自动关闭它并将其保存到文件系统。最后三行我们打开刚刚创建的存档，并打印出其中包含的文件的名称。</p>
<p>要将新文件添加到现有存档，可以以追加模式（&rsquo;a&rsquo;）打开存档：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="k">with</span> <span class="n">tarfile</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">&#39;package.tar&#39;</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="s1">&#39;a&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">tar</span><span class="p">:</span>
<span class="o">...</span>     <span class="n">tar</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="s1">&#39;foo.bar&#39;</span><span class="p">)</span>

<span class="o">&gt;&gt;&gt;</span> <span class="k">with</span> <span class="n">tarfile</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">&#39;package.tar&#39;</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="s1">&#39;r&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">tar</span><span class="p">:</span>
<span class="o">...</span>     <span class="k">for</span> <span class="n">member</span> <span class="ow">in</span> <span class="n">tar</span><span class="o">.</span><span class="n">getmembers</span><span class="p">():</span>
<span class="o">...</span>         <span class="nb">print</span><span class="p">(</span><span class="n">member</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
<span class="n">app</span><span class="o">.</span><span class="n">py</span>
<span class="n">config</span><span class="o">.</span><span class="n">py</span>
<span class="n">CONTRIBUTORS</span><span class="o">.</span><span class="n">md</span>
<span class="n">tests</span><span class="o">.</span><span class="n">py</span>
<span class="n">foo</span><span class="o">.</span><span class="n">bar</span>
</code></pre></div>
<p>在追加模式（&rsquo;a&rsquo;）下打开存档允许我们向其添加新文件而不删除其中已存在的文件。</p>
<h2 id="处理压缩归档">处理压缩归档<a class="headerlink" href="#处理压缩归档" title="Permanent link">&para;</a></h2>
<p><code>tarfile</code>还可以使用<code>gzip</code>，<code>bzip2</code>和<code>lzma</code> 来读取和写入 TAR 的压缩文件。要读取或写入压缩存档，请使用<code>tarfile.open()</code>，为压缩类型传递适当的模式。</p>
<p>例如，要读取或写入使用 gzip 压缩的 TAR 存档数据，请分别使用 &lsquo;r：gz&rsquo; 或 &lsquo;w：gz&rsquo; 模式：</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">files</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;app.py&#39;</span><span class="p">,</span> <span class="s1">&#39;config.py&#39;</span><span class="p">,</span> <span class="s1">&#39;tests.py&#39;</span><span class="p">]</span>
<span class="o">&gt;&gt;&gt;</span> <span class="k">with</span> <span class="n">tarfile</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">&#39;packages.tar.gz&#39;</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="s1">&#39;w:gz&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">tar</span><span class="p">:</span>
<span class="o">...</span>     <span class="n">tar</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="s1">&#39;app.py&#39;</span><span class="p">)</span>
<span class="o">...</span>     <span class="n">tar</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="s1">&#39;config.py&#39;</span><span class="p">)</span>
<span class="o">...</span>     <span class="n">tar</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="s1">&#39;tests.py&#39;</span><span class="p">)</span>

<span class="o">&gt;&gt;&gt;</span> <span class="k">with</span> <span class="n">tarfile</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">&#39;packages.tar.gz&#39;</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="s1">&#39;r:gz&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">t</span><span class="p">:</span>
<span class="o">...</span>     <span class="k">for</span> <span class="n">member</span> <span class="ow">in</span> <span class="n">t</span><span class="o">.</span><span class="n">getmembers</span><span class="p">():</span>
<span class="o">...</span>         <span class="nb">print</span><span class="p">(</span><span class="n">member</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
<span class="n">app</span><span class="o">.</span><span class="n">py</span>
<span class="n">config</span><span class="o">.</span><span class="n">py</span>
<span class="n">tests</span><span class="o">.</span><span class="n">py</span>
</code></pre></div>
<p>&lsquo;w：gz&rsquo; 可以以 gzip 压缩写入的方式打开压缩的存档文件，&rsquo;r：gz&rsquo; 模式则可以以 gzip 压缩读取的方式打开压缩的存档文件。需要注意的是，我们无法在追加模式下打开压缩的存档。要将文件添加到压缩存档，我们必须创建新存档。</p>
<h1 id="创建归档更简单的方法">创建归档更简单的方法<a class="headerlink" href="#创建归档更简单的方法" title="Permanent link">&para;</a></h1>
<p>Python 标准库还支持使用<code>shutil</code>模块中的高级方法创建 TAR 和 ZIP 存档。<code>shutil</code>中的归档实用程序允许我们创建，读取和提取 ZIP 和 TAR 归档文件。这些实用程序依赖于较低级别的<code>tarfile</code>和<code>zipfile</code>模块。</p>
<h2 id="使用-shutilmake_archive-处理存档">使用 <code>shutil.make_archive()</code> 处理存档<a class="headerlink" href="#使用-shutilmake_archive-处理存档" title="Permanent link">&para;</a></h2>
<p><code>shutil.make_archive()</code>至少有两个参数：归档的名称和归档格式。</p>
<p>默认情况下，它将当前目录中的所有文件压缩为<code>format</code>参数中指定的归档格式。我们也可以传入可选的<code>root_dir</code>参数来压缩不同目录中的文件。<code>.make_archive()</code>支持 zip，tar，bztar 和 gztar 存档格式。</p>
<p>这是使用<code>shutil</code>创建 TAR 存档的方法：</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">shutil</span>

<span class="c1"># shutil.make_archive(base_name, format, root_dir)</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">make_archive</span><span class="p">(</span><span class="s1">&#39;data/backup&#39;</span><span class="p">,</span> <span class="s1">&#39;tar&#39;</span><span class="p">,</span> <span class="s1">&#39;data/&#39;</span><span class="p">)</span>
</code></pre></div>
<p>上面程序将复制 <code>data/</code> 中的所有内容，并在文件系统中创建名为 <code>backup.tar</code> 的存档并返回其名称。要提取存档，我们可以调用 <code>.unpack_archive()</code>：</p>
<div class="highlight"><pre><span></span><code><span class="n">shutil</span><span class="o">.</span><span class="n">unpack_archive</span><span class="p">(</span><span class="s1">&#39;backup.tar&#39;</span><span class="p">,</span> <span class="s1">&#39;extract_dir/&#39;</span><span class="p">)</span>
</code></pre></div>
<p>这行代码调用了<code>.unpack_archive()</code>并传入存档名称和目标目录，它会将 <code>backup.tar</code> 的内容提取到 <code>extract_dir/</code> 中。 ZIP 存档也可以以相同的方式创建和提取。</p>
<h1 id="读取多个文件">读取多个文件<a class="headerlink" href="#读取多个文件" title="Permanent link">&para;</a></h1>
<p>Python 支持通过 <code>fileinput</code> 模块从多个输入流或文件列表中读取数据。此模块允许我们快速轻松地循环遍历一个或多个文本文件的内容。以下是使用 <code>fileinput</code> 的典型方法：</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">fileinput</span>
<span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">fileinput</span><span class="o">.</span><span class="n">input</span><span class="p">()</span>
    <span class="n">process</span><span class="p">(</span><span class="n">line</span><span class="p">)</span>
</code></pre></div>
<p><code>fileinput</code> 默认从传递给 <code>sys.argv</code> 的命令行参数中获取其输入。</p>
<h2 id="使用-fileinput-循环遍历多个文件">使用 <code>fileinput</code> 循环遍历多个文件<a class="headerlink" href="#使用-fileinput-循环遍历多个文件" title="Permanent link">&para;</a></h2>
<p>让我们使用 <code>fileinput</code> 构建一个普通的 UNIX 实用程序 <code>cat</code> 的原始版本。<code>cat</code> 实用程序将按顺序读取文件，将它们写入标准输出。当在命令行参数中给出多个文件时，<code>cat</code> 将连接文本文件并在终端中显示结果：</p>
<div class="highlight"><pre><span></span><code><span class="c1"># File: fileinput-example.py</span>
<span class="kn">import</span> <span class="nn">fileinput</span>
<span class="kn">import</span> <span class="nn">sys</span>

<span class="n">files</span> <span class="o">=</span> <span class="n">fileinput</span><span class="o">.</span><span class="n">input</span><span class="p">()</span>
<span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">files</span><span class="p">:</span>
    <span class="k">if</span> <span class="n">fileinput</span><span class="o">.</span><span class="n">isfirstline</span><span class="p">():</span>
        <span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;</span><span class="se">\n</span><span class="s1">--- Reading </span><span class="si">{</span><span class="n">fileinput</span><span class="o">.</span><span class="n">filename</span><span class="p">()</span><span class="si">}</span><span class="s1"> ---&#39;</span><span class="p">)</span>
    <span class="nb">print</span><span class="p">(</span><span class="s1">&#39; -&gt; &#39;</span> <span class="o">+</span> <span class="n">line</span><span class="p">,</span> <span class="n">end</span><span class="o">=</span><span class="s1">&#39;&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">()</span>
</code></pre></div>
<p>在当前目录中的两个文本文件上运行此命令会产生以下输出：</p>
<div class="highlight"><pre><span></span><code><span class="err">$</span> <span class="n">python3</span> <span class="n">fileinput</span><span class="o">-</span><span class="n">example</span><span class="o">.</span><span class="n">py</span> <span class="n">bacon</span><span class="o">.</span><span class="n">txt</span> <span class="n">cupcake</span><span class="o">.</span><span class="n">txt</span>
<span class="o">---</span> <span class="n">Reading</span> <span class="n">bacon</span><span class="o">.</span><span class="n">txt</span> <span class="o">---</span>
 <span class="o">-&gt;</span> <span class="n">Spicy</span> <span class="n">jalapeno</span> <span class="n">bacon</span> <span class="n">ipsum</span> <span class="n">dolor</span> <span class="n">amet</span> <span class="ow">in</span> <span class="ow">in</span> <span class="n">aute</span> <span class="n">est</span> <span class="n">qui</span> <span class="n">enim</span> <span class="n">aliquip</span><span class="p">,</span>
 <span class="o">-&gt;</span> <span class="n">irure</span> <span class="n">cillum</span> <span class="n">drumstick</span> <span class="n">elit</span><span class="o">.</span>
 <span class="o">-&gt;</span> <span class="n">Doner</span> <span class="n">jowl</span> <span class="n">shank</span> <span class="n">ea</span> <span class="n">exercitation</span> <span class="n">landjaeger</span> <span class="n">incididunt</span> <span class="n">ut</span> <span class="n">porchetta</span><span class="o">.</span>
 <span class="o">-&gt;</span> <span class="n">Tenderloin</span> <span class="n">bacon</span> <span class="n">aliquip</span> <span class="n">cupidatat</span> <span class="n">chicken</span> <span class="n">chuck</span> <span class="n">quis</span> <span class="n">anim</span> <span class="n">et</span> <span class="n">swine</span><span class="o">.</span>
 <span class="o">-&gt;</span> <span class="n">Tri</span><span class="o">-</span><span class="n">tip</span> <span class="n">doner</span> <span class="n">kevin</span> <span class="n">cillum</span> <span class="n">ham</span> <span class="n">veniam</span> <span class="n">cow</span> <span class="n">hamburger</span><span class="o">.</span>
 <span class="o">-&gt;</span> <span class="n">Turkey</span> <span class="n">pork</span> <span class="n">loin</span> <span class="n">cupidatat</span> <span class="n">filet</span> <span class="n">mignon</span> <span class="n">capicola</span> <span class="n">brisket</span> <span class="n">cupim</span> <span class="n">ad</span> <span class="ow">in</span><span class="o">.</span>
 <span class="o">-&gt;</span> <span class="n">Ball</span> <span class="n">tip</span> <span class="n">dolor</span> <span class="n">do</span> <span class="n">magna</span> <span class="n">laboris</span> <span class="n">nisi</span> <span class="n">pancetta</span> <span class="n">nostrud</span> <span class="n">doner</span><span class="o">.</span>

<span class="o">---</span> <span class="n">Reading</span> <span class="n">cupcake</span><span class="o">.</span><span class="n">txt</span> <span class="o">---</span>
 <span class="o">-&gt;</span> <span class="n">Cupcake</span> <span class="n">ipsum</span> <span class="n">dolor</span> <span class="n">sit</span> <span class="n">amet</span> <span class="n">candy</span> <span class="n">I</span> <span class="n">love</span> <span class="n">cheesecake</span> <span class="n">fruitcake</span><span class="o">.</span>
 <span class="o">-&gt;</span> <span class="n">Topping</span> <span class="n">muffin</span> <span class="n">cotton</span> <span class="n">candy</span><span class="o">.</span>
 <span class="o">-&gt;</span> <span class="n">Gummies</span> <span class="n">macaroon</span> <span class="n">jujubes</span> <span class="n">jelly</span> <span class="n">beans</span> <span class="n">marzipan</span><span class="o">.</span>
</code></pre></div>
<p><code>fileinput</code> 允许我们检索有关每一行的更多信息，例如它是否是第一行(<code>.isfirstline()</code>)，行号(<code>.lineno()</code>) 和文件名(<code>.filename()</code>)。 更多关于 <code>fileinput</code> 的内容，我们可以点击<a href="https://docs.python.org/3/library/fileinput.html">这里</a>查看。</p>
<h1 id="总结">总结<a class="headerlink" href="#总结" title="Permanent link">&para;</a></h1>
<p>现在我们已经知道如何使用 Python 对文件和文件组执行最常见的操作。同时也已经了解了用于读取，查找和操作它们的不同内置模块。</p>
<p>现在我们可以使用 Python 来：</p>
<ul>
<li>获取目录内容和文件属性</li>
<li>创建目录和目录树</li>
<li>在文件名中查找模式</li>
<li>创建临时文件和目录</li>
<li>移动，重命名，复制和删除文件或目录</li>
<li>从不同类型的档案中读取和提取数据</li>
<li>使用<code>fileinput</code>同时读取多个文件</li>
</ul>
<p>英文原文：<a href="https://realpython.com/working-with-files-in-python/">https://realpython.com/working-with-files-in-python/</a></p>







  
    
  
  


  <aside class="md-source-file">
    
      
  <span class="md-source-file__fact">
    <span class="md-icon" title="最后更新">
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21 13.1c-.1 0-.3.1-.4.2l-1 1 2.1 2.1 1-1c.2-.2.2-.6 0-.8l-1.3-1.3c-.1-.1-.2-.2-.4-.2m-1.9 1.8-6.1 6V23h2.1l6.1-6.1-2.1-2M12.5 7v5.2l4 2.4-1 1L11 13V7h1.5M11 21.9c-5.1-.5-9-4.8-9-9.9C2 6.5 6.5 2 12 2c5.3 0 9.6 4.1 10 9.3-.3-.1-.6-.2-1-.2s-.7.1-1 .2C19.6 7.2 16.2 4 12 4c-4.4 0-8 3.6-8 8 0 4.1 3.1 7.5 7.1 7.9l-.1.2v1.8Z"/></svg>
    </span>
    <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-iso_date">2024-04-15</span>
  </span>

    
    
    
    
  </aside>


  




                
              </article>
            </div>
          
          
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
        </div>
        
          <button type="button" class="md-top md-icon" data-md-component="top" hidden>
  
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12Z"/></svg>
  回到页面顶部
</button>
        
      </main>
      
        <footer class="md-footer">
  
    
      
      <nav class="md-footer__inner md-grid" aria-label="页脚" >
        
          
          <a href="../2019-09-19-xu2eg5/" class="md-footer__link md-footer__link--prev" aria-label="上一页: Python 文件下载并显示下载进度条">
            <div class="md-footer__button md-icon">
              
              <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
            </div>
            <div class="md-footer__title">
              <span class="md-footer__direction">
                上一页
              </span>
              <div class="md-ellipsis">
                Python 文件下载并显示下载进度条
              </div>
            </div>
          </a>
        
        
          
          <a href="../2019-06-11-iddn10/" class="md-footer__link md-footer__link--next" aria-label="下一页: Python 读取大文件">
            <div class="md-footer__title">
              <span class="md-footer__direction">
                下一页
              </span>
              <div class="md-ellipsis">
                Python 读取大文件
              </div>
            </div>
            <div class="md-footer__button md-icon">
              
              <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4Z"/></svg>
            </div>
          </a>
        
      </nav>
    
  
  <div class="md-footer-meta md-typeset">
    <div class="md-footer-meta__inner md-grid">
      <!--
  Copyright (c) 2016-2023 Martin Donath <martin.donath@squidfunk.com>

  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to
  deal in the Software without restriction, including without limitation the
  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  sell copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  IN THE SOFTWARE.
-->

<!-- Copyright and theme information -->
<div class="md-copyright">
  
    <div class="md-copyright__highlight">
      版权所有 © 2023-2024 <a href="https://github.com/orgs/BioITee/discussions" target="_blank">BioIT 爱好者</a>
    </div>
  
  
    Made with
    <a
      href="https://squidfunk.github.io/mkdocs-material/"
      target="_blank" rel="noopener"
    >
      Material for MkDocs
    </a> | <a href="http://beian.miit.gov.cn/" target="_blank" rel="noopener">粤ICP备16023717号</a>
  
</div>
      
        <div class="md-social">
  
    
    
    
    
    <a href="https://github.com/shenweiyan" target="_blank" rel="noopener" title="GitHub" class="md-social__link">
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/></svg>
    </a>
  
    
    
    
    
    <a href="https://twitter.com/weiyanshum" target="_blank" rel="noopener" title="Twitter" class="md-social__link">
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"/></svg>
    </a>
  
    
    
      
    
    
    
    <a href="https://genomic.social/@weiyanshum" target="_blank" rel="noopener me" title="Mastodon" class="md-social__link">
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M433 179.11c0-97.2-63.71-125.7-63.71-125.7-62.52-28.7-228.56-28.4-290.48 0 0 0-63.72 28.5-63.72 125.7 0 115.7-6.6 259.4 105.63 289.1 40.51 10.7 75.32 13 103.33 11.4 50.81-2.8 79.32-18.1 79.32-18.1l-1.7-36.9s-36.31 11.4-77.12 10.1c-40.41-1.4-83-4.4-89.63-54a102.54 102.54 0 0 1-.9-13.9c85.63 20.9 158.65 9.1 178.75 6.7 56.12-6.7 105-41.3 111.23-72.9 9.8-49.8 9-121.5 9-121.5zm-75.12 125.2h-46.63v-114.2c0-49.7-64-51.6-64 6.9v62.5h-46.33V197c0-58.5-64-56.6-64-6.9v114.2H90.19c0-122.1-5.2-147.9 18.41-175 25.9-28.9 79.82-30.8 103.83 6.1l11.6 19.5 11.6-19.5c24.11-37.1 78.12-34.8 103.83-6.1 23.71 27.3 18.4 53 18.4 175z"/></svg>
    </a>
  
</div>
      
    </div>
  </div>
</footer>
      
    </div>
    <div class="md-dialog" data-md-component="dialog">
      <div class="md-dialog__inner md-typeset"></div>
    </div>
    
    
    <script id="__config" type="application/json">{"base": "../../../..", "features": ["navigation.instant", "navigation.tracking", "navigation.tabs", "navigation.indexes", "navigation.top", "navigation.sections", "navigation.path", "content.action.edit", "content.action.view", "content.code.copy", "navigation.footer"], "search": "../../../../assets/javascripts/workers/search.f886a092.min.js", "translations": {"clipboard.copied": "\u5df2\u590d\u5236", "clipboard.copy": "\u590d\u5236", "search.result.more.one": "\u5728\u8be5\u9875\u4e0a\u8fd8\u6709 1 \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.more.other": "\u5728\u8be5\u9875\u4e0a\u8fd8\u6709 # \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.none": "\u6ca1\u6709\u627e\u5230\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.one": "\u627e\u5230 1 \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.other": "# \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.placeholder": "\u952e\u5165\u4ee5\u5f00\u59cb\u641c\u7d22", "search.result.term.missing": "\u7f3a\u5c11", "select.version": "\u9009\u62e9\u5f53\u524d\u7248\u672c"}}</script>
    
    
      <script src="../../../../assets/javascripts/bundle.d7c377c4.min.js"></script>
      
        <script src="../../../../js/mathjax.js"></script>
      
        <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
      
        <script src="https://cdn.bootcss.com/mathjax/3.0.5/es5/tex-mml-chtml.js"></script>
      
    
  <script>document$.subscribe(() => {const lightbox = GLightbox({"touchNavigation": true, "loop": false, "zoomable": true, "draggable": true, "openEffect": "zoom", "closeEffect": "zoom", "slideEffect": "slide"});})</script></body>
</html>